--azLHFNyN32YCQGCU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
A couple weeks ago I wrote a little script [1] to rotate photos
based on the exif orientation setting within the photos, using
jpegtran.
I got sidetracked on a small but annoying issue: once the image
has been rotated, I'd like to reset the exif 'Orientation' field
to 1. (at least, I assume that's what should be done?)
I had written another kludgy script [2] to do that, but it seems
it only works with output from my Canon G2, not other cameras :)
So I tried to use 'exif' instead, and that works well but it also
decreases the file size by ~400 bytes, which makes me nervous.
I wrote to libexif-devel about that (attached), and one of the
developers replied [3] saying it might be nothing, but wasn't sure.
Anyway, the orientation setting isn't the only thing that needs
updating once images have been rotated: height/width do as well.
(variants of photos like foo-med.jpg may also need updating:
should the exif metadata within those files refer to the original
file, or the variant itself?)
Does anyone else care about stuff like this? What do you do?
(or, what do you think should be done)
[1]
http://impressive.net/software/photo/source/rotate-images
[2]
http://impressive.net/software/photo/source/exifmunge
[3] mid:1057908543.577.161.camel@lutz
apparently not archived online. Lutz wrote:
libexif constructs EXIF data from scratch, without any unnecessary
padding. Read the EXIF spec: The pointers to the EXIF data items are
stored in one block, and the data items itself somewhere after the
block. But the data items don't need to start right after the block of
pointers, nor do they need to be packed one after another.
This could be the 400 bytes. But it would still be interesting what is
hidden in the 400 bytes...
--
Gerald Oskoboiny <
[email protected]>
http://impressive.net/people/gerald/
--azLHFNyN32YCQGCU
Content-Type: message/rfc822
Content-Disposition: inline
Date: Thu, 10 Jul 2003 19:15:16 -0400
From: Gerald Oskoboiny <
[email protected]>
To:
[email protected]
Subject: file size decreases after exif --set-value?
Message-ID: <
[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.28i
Hi,
Thanks for writing libexif, gexif, exif, etc; fantastic stuff!
I am trying to use 'exif' to reset the orientation value in a jpeg
file after rotating it with jpegtran, and it seems to work well
but the file size decreases by 400 bytes during the exif step.
$ exif --ifd=0 -tag=0x0112 --set-value=1 11-23-06.jpg
Wrote file '11-23-06.jpg.modified.jpeg'.
$ ls -l 11-23-06*
-rw-r--r-- 1 gerald 1249462 Jul 10 18:27 11-23-06.jpg
-rw-r--r-- 1 gerald 1249066 Jul 10 18:28 11-23-06.jpg.modified.jpeg
This makes me a little nervous because I don't know what was lost.
It may be that libexif's canonical exif output is just a bit less
verbose than that used by Canon, but it would be nice to know I'm
not losing anything important.
I checked for a few obvious things that might have gone missing
(exif data, image thumbnail), but they're still there.
my test file came from a Canon G2:
http://impressive.net/people/gerald/2002/09/29/11-23-06.jpg
and I am using the latest released exif (0.6) and related libraries.
Does anyone know what those ~400 bytes might be?
Thanks,
--
Gerald Oskoboiny <
[email protected]>
http://impressive.net/people/gerald/
--azLHFNyN32YCQGCU--