Bug 106060 - Add support for EXIF in jpegtran and rdjpgcom tools
Summary: Add support for EXIF in jpegtran and rdjpgcom tools
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: libjpeg
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Matthias Clasen
QA Contact: David Lawrence
Keywords: FutureFeature
Depends On:
TreeView+ depends on / blocked
Reported: 2003-10-02 13:04 UTC by diego.santacruz
Modified: 2007-04-18 16:58 UTC (History)
0 users

Clone Of:
Last Closed: 2005-03-07 04:09:49 UTC

Attachments (Terms of Use)
Patch for basic EXIF support in jpegtran (16.62 KB, patch)
2003-10-02 13:47 UTC, diego.santacruz
no flags Details | Diff
Patch to implement the requested rdjpeg features (5.27 KB, patch)
2003-10-02 13:51 UTC, diego.santacruz
no flags Details | Diff

Description diego.santacruz 2003-10-02 13:04:27 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.7 (X11; Linux i686; U;) Gecko/20030131

Description of problem:
Current versions of jpegtran and rdjpgcom tools of libjpeg are not aware  of the
EXIF kind of JPEG files.

In jpegtran, even using the '-copy all' does not treat EXIF files correctly. The
problems are

1. A JFIF marker is always added to the output file, which is incompatible with
EXIF (EXIF requires that EXIF marker be first extra marker, but JFIF has the
same requirement).

2. Upon a geometric transformation (e.g., 90 deg rotation) the image dimension
fields in the EXIF marker are not updated.

3. Upon a geometric transformation the EXIF orientation flag is not reset.

As EXIF files become increasingly popular as they are produced by nearly all
digital cameras, this issues create a bunch of problems with dealing with EXIF

Also rdjpgcom should probably report the EXIF orientation when in verbose mode.

Version-Release number of selected component (if applicable):

Comment 1 diego.santacruz 2003-10-02 13:47:34 UTC
Created attachment 94878 [details]
Patch for basic EXIF support in jpegtran

This patch adds the requested features to jpegtran. It basically does:

1. Recognizes EXIF files as such and does not add an incompatible JFIF marker.
2. Upon a geometric transformation it adjusts the dimensions in the EXIF marker
to match the JPEG image dimensions.
3. Upon a geometric transformation it resets the EXIF orientation flag so that
the resulting JPEG image is considered to be in the upright position already.
4. Add the option '-copy exif' that allows to recover an EXIF file to which a
JFIF marker was incorrectly added.

The patch does not affect the library code, only the jpegtran code and
therefore it should not pose any compatibility problems.

Comment 2 diego.santacruz 2003-10-02 13:51:50 UTC
Created attachment 94879 [details]
Patch to implement the requested rdjpeg features

This patch adds basic EXIF support to rdjpgcom: in -verbose mode it prints the
EXIF orientation, if any is found.

This, in conjunction to the patched jpegtran, allows to write scripts that
automatically orient images based on the EXIF orientation field (used by some
digital cameras for this very same purpose).

The patch does not modify any library code, so it should not present any
compatibility problems.

Comment 3 diego.santacruz 2003-10-02 14:03:42 UTC
I have also reported these patches to the IJG at jpeg-info@uunet.uu.net

Comment 4 Matthias Clasen 2005-03-07 04:09:49 UTC
I believe that these features would best be done by packaging jhead for Fedora.

Note You need to log in before you can comment on or make changes to this bug.