lua-users home
lua-l archive

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


On Tue, Feb 21, 2012 at 9:00 AM, Stuart P. Bentley wrote:


> local file = io.open("corrupt-jpeg.jpg",'w')

> You can open the file that outputs to see how it's being corrupted (and you
> can check that it's line-ending coercion in a hex editor).

> Any ideas for how to fix?

Maybe try 'wb' instead of 'w':

local file = io.open("corrupt-jpeg.jpg",'wb')

 - Jeff