lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Stuart P. Bentley wrote:
[...]
> local file = io.open("corrupt-jpeg.jpg",'w')
[...]
> Any ideas for how to fix?

Open with 'wb' instead --- you've told it it's a text file, and it's
doing Unix<->DOS line ending conversion.

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "I have always wished for my computer to be as easy to use as my
│ telephone; my wish has come true because I can no longer figure out
│ how to use my telephone." --- Bjarne Stroustrup

Attachment: signature.asc
Description: OpenPGP digital signature