[Nottingham] Tweaking the orientation flag in a jpeg

Martin martin at ml1.co.uk
Fri Sep 3 16:34:02 UTC 2010


On 03/09/10 12:20, Martin wrote:
[---]
> 
> This should work better:
> 
[---]
> 
> To test first for a \001 gets a bit more messy:
> 
> f="2.JPG" ; os="54" ; a="$( echo -e "\001" )" ; b="$( echo -e "\006" )"
> ; [ "$( dd bs=1 count=1 skip="$os" if="$f" )" == "$a" ] && echo "$b" |
> dd bs=1 count=1 seek="$os" conv=notrunc of="$f"
> 
> (That lot is all on one line!)
> 
> Change the file for 'f' as appropriate.

OK, wrapping all that up in some pretty bash gives the attached example.


Anyone for testing it?

Add proper flag handling and checking?

Graham: Can you add a note to the list to say why it's needed for your
camera files? (So that Google can pick it up from the archives for
others to use...)


Cheers,
Martin

ps: OK, so I couldn't resist a pun on "dd" :-)

-- 
----------------
Martin Lomas
martin at ml1.co.uk
----------------
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bb
URL: <http://mailman.lug.org.uk/pipermail/nottingham/attachments/20100903/93669f3c/attachment.txt>


More information about the Nottingham mailing list