2

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.

user2450099
  • 375
  • 3
  • 7
  • 16

3 Answers3

2

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.

keithhatfield
  • 3,273
  • 1
  • 17
  • 24
1

Take a look at this extension for PHP: http://lsolesen.github.io/pel/

Rob
  • 11,492
  • 14
  • 59
  • 94
-1

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

This_is_me
  • 908
  • 9
  • 20