Archive for the ‘PHP’ Category.

PEL version 0.5 released

The PHP EXIF Library (PEL) is written in pure PHP and makes it easy to read and write EXIF headers found in JPEG and TIFF images.


This release has been tested with images from a number of different camera models (from Fujifilm, Nikon, Ricoh, Sony, and Canon), leading to the discovery and fixing of a number of bugs. The API for PelJpeg::getSection() was changed slightly, making it more convenient to use. All classes and methods are now documented.


  • Some images have content following the EOI marker — this would make PEL thrown an exception. The content is now stored as a PelJpegContent object associated with the fictive marker 0x00.

  • Added code to handle images where the length of the thumbnail image is broken. PEL would previously throw an exception, but the length is now adjusted instead, and the parsing continues.

  • Fixed a number of bugs regarding the conversion back and forth between integers and bytes. These bugs affected the parsing of large integers that would overflow a signed 32 bit integer.

  • Fixed bug #976782. If an image contains two APP1 sections, PEL would crash trying to parse the second non-EXIF section. PEL will now just store a non-EXIF APP1 section as a generic PelJpegContent object.

  • Removed the PelJpegSection class. This lead to a rewrite of the PelJpeg::getSection() method, so that it now takes a PelJpegMarker as argument instead of the section number.

  • The byte order can now be specified when a PelTiff object is converted into bytes.

  • Updated documentation, PEL is now fully documented.

Download PEL

PEL is hosted on SourceForge: (354 KiB) (514 KiB) (676 KiB)

PEL Version 0.4 Released

I’ve released my favorite project — the PHP EXIF Library — once again. This time the focus is on making PEL speak other languages than English. The release notes and a summary of the changes follow.


The infrastructure for internationalisation has been put in place. Preliminary translations for Danish, German, French, and Spanish is included. Support for tags with GPS information were disabled due to conflicts with a number of normal tags.


  • Disabled the code that tries to lookup the title and description of the GPS related tags, since those tags have the same hexadecimal value as a number of other normal tags. This means that there’s no support for tags with GPS information.

  • Marked strings for translation throughout the source code.

  • Added German, French, and Spanish translations taken from libexif. The translations were made by Lutz Müller, Fabian Mandelbaum, and Arnaud Launay, respectively.

  • Added Danish translation.

  • Added new static methods Pel::tra() and Pel::fmt() which are used for interaction with Gettext. The first function simply translates its argument, the second will in addition function like sprintf() when given several arguments.

  • Updated documentation, both the doc comments in the code and the README and INSTALL files.

The PHP EXIF Library version 0.3 has been released

The latest version of PEL sports support for TIFF images and lots of other improvements. Read the announcement below, and go to the project page to download it.


Support was added for parsing TIFF images, leading to a mass renaming of files and classes to cleanup the class hierarchy. The decoding of EXIF data is now tested against known values (over 400 individual tests), this lead to the discovery of a couple of subtle bugs. The documentation has been updated and expanded.


  • Renamed all files and classes so that only EXIF specific code is labeled with Exif. So, for example, PelExifIfd is now PelIfd, since the IFD structure isn’t specific to EXIF but rather to TIFF images. The same applies to the former PelExifEntry* classes.

  • Fixed offset bug in PelDataWindow::getBytes() which caused the method to return too much data.

  • Added support for the SCENE_TYPE tag.

  • Fixed display of integer version numbers. Version “x.0″ would be
    displayed as just version “x” before.

  • Unit tests for EXIF decoding. PEL is now tested with an image from a Sony DSC V1 and one from a Canon IXUS II.

  • Changed all occurrences of include_once() to require_once() since the files are indeed required.

  • Updated documentation all over.

Hurry! PEL version 0.2 has escaped!

The PHP EXIF Library (PEL) is getting better and better, and version 0.2 was released today — go grab it if you want to play with it.


This release brings updated documentation and better support for the EXIF user comment tag and tags containing version information. The code is now tested using SimpleTest.


  • All PelExifEntry descendant classes now use setValue() and
    getValue() methods consistently.

  • Signed and unsigned numbers (bytes, shorts, longs, and rationals) are now handled correctly.

  • The SimpleTest ( framework is used for regression testing.

  • Added new PelExifEntryUserComment class to better support the EXIF user comment tag.

  • Added new PelExifEntryVersion class to support the EXIF tags with version information, namely the EXIF_VERSION, FLASH_PIX_VERSION, and INTEROPERABILITY_VERSION tags.

  • Updated doc comments all over.

The PHP EXIF Library was on Freshmeat

Although SourceForge is slow with their updates of the statistics on the PEL project pages, I hope a few people have taken the oppotunity to download it. And accourding to the Freshmeat PEL page, then there has indeed been several hundred visits to either the PEL homepage or one of the files available at SourceForge for download.

I realize that PEL will have a limited audience the first few months, since it’s written in the yet-to-be-released version 5 of the PHP. This version is greatly improved, and I can only encourage people to download it right away and start playing with it — and why not use PEL which uses a lot of new PHP5 features. Go download PEL and play!