WordPress 2.6 and EXIF Extraction

I’ve been having this problem for a better part of almost two weeks now. I finally figured out the solution to the problem. With WordPress 2.6, one of the new built in features is the ability to extract EXIF data from a JPEG, store it in the database, and allow you to make a call for it. This is to complement the new built in gallery feature that was introduced in WordPress 2.5.

MAMP stands for Mac, Apache, MySQL, and PHP. It's great software that let's you develop offline.

MAMP stands for Mac, Apache, MySQL, and PHP. It's great software that let's you develop offline.

My problem had been that no matter what images I would upload, the EXIF data was not being extracted. Interestingly enough, the IPTC tags were. People kept telling me that maybe it was my images and the EXIF data didn’t exist in the images I was uploading. But that wasn’t the problem because I could upload it to Flickr and the EXIF would display fine. I also checked the EXIF in Photoshop CS3 and it was fine also. Couldn’t figure out the issue.

I had about given up on ever being able to display the EXIF data on my blog until today, I was making some design changes to this theme on MAMP and decided to just layout the look of the EXIF data just in case I figured out a solution one day and to my surprise, the EXIF data showed up!

This is what you should see in your PHPInfo to know that the EXIF extension has loaded correctly.

This is what you should see in your PHPInfo to know that the EXIF extension has loaded correctly.

After a bit of digging, turns out that the PHP EXIF extension was not enabled on my VPS (virtual private server). The beauty of MAMP is that practically all the extensions are turned on and I was able to immediately see the problem.

Now enabling the EXIF extension on PHP takes a bit of work and the wonderful techs at my web host, Autica (a part of MidPhase that is also part of AN Hosting), are currently working on getting it enabled for me. It sounds easy, but it’s complicated and easy to screw up if you’re not careful. You have to uncomment the line that executes the EXIF extension in your php.ini file and then recompile Apache. I think most people on shared hosting won’t have to worry about this, depending on host, it should be enabled and compiled. But if you notice that the EXIF data isn’t be extracted, then create a phpinfo file and run it on your web server to see if EXIF is installed. Now I have to go back and reupload all the images that I uploaded when the EXIF extension wasn’t active. Fortunately that only means some 9 albums as I hadn’t put up all the old and new albums just yet.

Also if you are interested in the code that is necessary to extract the EXIF, please see this post by Sarah as this was the first post I could find via Google that showed the code on how to do it.

[UPDATE 2008-08-02: My webhost has successfully enabled the EXIF extension! Apparently what was causing the delay was that the Apache version, for some reason, wouldn't recompile with eaccelerator. So now Apache has been recompiled with EXIF but no eaccelerator until a partch by Apache comes out. Thanks Autica!]

Related Posts with Thumbnails You can leave a response, or trackback from your own site.
1 Comment Web

Comments

One Comment so far. You can leave a response, or trackback from your own site.
  1. ume,

    thanks for this article it helps! :) i was making photoblog myself, tried it on Localhost and it works fine, then uploaded on webserver but i got nothing. After i asked my host to enable it (sent your blog link to them ;p) then in only 1 hour things worked perfect!

Add Your Comments

Required
Required
Tips

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <ol> <ul> <li> <q cite=""> <strike> <strong> <sub> <sup> <u>

Your email is never published nor shared.

Ready?