Reading/writing image exif data with PHP

Choices of reading: built-in exif_read_data (PHP 4.2+) or exifReader class from

For writing, there is no built-in function. You'll need to use a custom solution.

You can also use ImageMagick for reading and writing exif data. For CentOS installation instructions go to Installing ImageMagick 6.6.9-7 and imagick 3.0.1 for PHP on CentOS 5.5 64 bit.

yum install ImageMagick ImageMagick-devel
yum remove ImageMagick
yum install libtool-ltdl libtool-ltdl-devel freetype freetype-devel fontconfig-devel

rpm -Uvh epel-release-5-4.noarch.rpm

yum --enablerepo=epel install jasper jasper-libs jasper-devel

rpm -Uvh ImageMagick-6.6.7-9.x86_64.rpm
rpm -Uvh ImageMagick-devel-6.6.7-9.x86_64.rpm

pecl install imagick

echo '' > /etc/php.d/imagick.ini
service httpd restart

The PHP interface to ImageMagick is at and exif extraction example is at

The interesting functions are imagick::getImageProperties and imagick::setImageProperty.

Image to check:


by PHP programming on 03 May 2011
I expect more than that from your blog so keep it up and great blog comparing to other one's you will give me the procedure for that because i was waiting for the replay I like to subscribe this blog. Thanks
Add your comment