[Nottingham] Tweaking the orientation flag in a jpeg

Roger Light roger at atchoo.org
Fri Sep 3 08:31:16 UTC 2010


Hi Camilo,

> If you have to write a program to tweak one byte in a file it might be
> worth looking at mmap(), there are examples online and there are fewer
> things to go wrong than if you try to read the whole file into memory.
> So a well written program using  mmap() might be smaller than one that
> uses traditional file IO.

A good point. I've not needed to use mmap before so it didn't cross my
mind, but it'd certainly be easier and less prone to error than
reading the file in.

Cheers,

Roger



More information about the Nottingham mailing list