[Nottingham] Tweaking the orientation flag in a jpeg

Martin martin at ml1.co.uk
Wed Sep 1 13:25:45 UTC 2010

On 01/09/10 12:44, Graham Dicker wrote:
> Hi everyone
> Does anyone know of a utility that can modify just one byte at a given offset 
> in a file? I want to change the orientation flag in a set of jpegs for which 
> lossless rotate is not an option. The flag is at the same offset in every file 
> and just needs to be changed from a 1 to a 6.

Clever use of "dd";

Or even program up your own little bit o' code to use the file operators
for that language...

And then for jpg files, that's the sort of operation that must be
available in such as ImageMagick (not lossless for rotate) or even exif
(exiftools) editors for the orientation tag...

Look up:



Then use a

for j in *.jpg ; do ... done

loop to run through them all...

That of help?

Let us know what you use,


Martin Lomas
martin at ml1.co.uk

More information about the Nottingham mailing list