Bug 106060

Summary: Add support for EXIF in jpegtran and rdjpgcom tools
Product: [Retired] Red Hat Linux Reporter: diego.santacruz
Component: libjpegAssignee: Matthias Clasen <mclasen>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 9Keywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-07 04:09:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch for basic EXIF support in jpegtran
none
Patch to implement the requested rdjpeg features none

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
images.

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

Version-Release number of selected component (if applicable):
libjpeg-6b-28

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.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.