Gallery2:Modules:exif:Development - Gallery Codex
Personal tools

Gallery2:Modules:exif:Development

From Gallery Codex

exif module Development

The EXIF module should rather be named "embeddedmetadata" module or so, since it's supposed to handle all embedded meta data. Embedded means in this context embedded in the binary image file.

Since the module could do a lot more and there are a lot of related feature requests as well as a general interest in these features, we have created this page to coordinate the development of the improvements of this module.

Current State

The exif module currently handles embedded EXIF and IPTC data in jpg and tiff images. It does the following:

  • Extract description, keyword and the timestamp from the embedded data and copies this data to the respective G2 item attributes
  • It offers a block to show EXIF / IPTC data on photo pages
  • It has a maintenance task to re-extract / capture the timestamp from the EXIF / IPTC data into the G2 item property
  • There's an admin configuration page to define what EXIF / IPTC fields should be shown in the block
  • There's a detailed / normal mode for the block
  • Offering an interface to fetch arbitrary EXIF / IPTC data. E.g. the map module uses this interface to get GPS coordinates

Missing features / Tasks

  • Auto-rotation of images based on the EXIF orientation field This been added in G2.2.
  • Storing the EXIF / IPTC data in the database instead of extracting it on each page load! This will also fix bug: 1376094 Performance issue for large images
  • Use IPTC to set description, keywords if it's set and has not been specified by the uploader (whatever the method used, GalleryRemote or the web form.
  • Using alternative libraries to read the EXIF / ... data since exifixer is now unmaintained and has a lot of bugs. exiftool (perl) is the obvious choice, some PHP alternatives could also be considered, but none of them is as mature as exiftool, by far.
  • Write EXIF / IPTC / ... data, currently we can only read.
  • Add XMP support. We should support more embedded data standards than just EXIF / IPTC.
  • Add support for RAW images: exifixer can't read exif data from RAW images.
  • Search EXIF / ... data
  • arbitrary metadata field lookup callback. code provided in: [1713194 exif: arbitrary metadata callback code]

Links

EXIF Tools / Libs

We need to evaluate alternatives to the now unmaintained exifixer library for robustness, features, active development, etc.

G2's metadata / exif module should be able to use one or more of them. Multiple metadata toolkits (exiftool, exifixer, ...) could be registered and used by G2.

Details

Storing the Data in the Database

This is discussed in detail in the above linked forum threads. We need 1 or 2 Map tables to map itemId, field and the field value.

Search

Once the data is stored in the database, we can implement the SearchInterface_1_0 in the exif module to add search support for all exif / iptc / ... values. See the comments module on how to implement and expose search support. It's also discussed a little in the above linked forum discussions.


Exiftool and other alternative libraries / tools

Our plan is to have a number of such parsers / libraries and the user can choose between them since not all can use a perl tool. First add support for exiftool. Then maybe look at the other alternatives mentioned in the above links.

Write support

Extend the exif interface to expose write capability to other modules. Also note that most libraries can only write if there is already an EXIF section in the image (they can only edit), most can't create a new EXIF section. exiftool can do everything :)

XMP Support

Once exiftool is used, we can add support for XMP, ... too.