Reputation: 385
Or other image file. Can this be done in a (fairly) simple way using PHP?
I'm coding a website that will allow users to upload photos, but I know JPEGs are notorious for their metadata and ideally I'd like to strip all images uploaded of metadata, either by removal or replacement with junk text.
Upvotes: 2
Views: 1235
Reputation: 3273
If you're just looking to strip most of the exif data quickly and easily without using a library to specifically write it, you can 'resave' the image using gd:
$file = 'myjpg.jpg';
$im = imagecreatefromjpeg($file);
imagejpeg($im, 'myjpg2.jpg');
Maybe not the best/prettiest solution, but it accomplishes what you want without adding additional libraries.
Upvotes: 2
Reputation: 918
i use getID3 library for this. it makes it quite easy
http://getid3.sourceforge.net/
it works with al lot of file extentions for a demo click here: demo
Upvotes: -1
Reputation: 11798
Take a look at this extension for PHP: http://lsolesen.github.io/pel/
Upvotes: 1