Jeff Abrahamson on 9 May 2005 00:22:44 -0000


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

[PLUG] jpeg maybe rotating


I recently discovered exiftran, which reads the exif tags of a jpeg
image.  Among other nice features is the -a flag which can
automatically rotate an image as indicated by the camera that took it
(for supported cameras, etc.).

The problem is that it always does its thing, just sometimes it's a
no-op.  That is, if the image doesn't need rotating, it doesn't say no
and not write anything: it just writes a new image with the same
orientation.  But the before and after images are not byte-for-byte
identical, so it's a visual no-op, not a bit no-op.

What I want is to script this so I can say

    if [ needs-rotating; ]; then
        mv file.jpg file.jpg.orig
        exiftran -a file.jpg.orig -o file.jpg
    fi

Any suggestions?

-- 
 Jeff

 Jeff Abrahamson  <http://www.purple.com/jeff/>    +1 215/837-2287
 GPG fingerprint: 1A1A BA95 D082 A558 A276  63C6 16BF 8C4C 0D1D AE4B

Attachment: signature.asc
Description: Digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug