0

How can file details like Authors, Copyright etc can be added to a image file with PHP ?

Example/Screenshoot of details:enter image description here

I created a script that takes a picture, adds to it in the right top corner the copyright and a ID number from the database automatically then it exports it to jpeg or png depending on the original image format. I also want to add "Copyright" and "Authors" details to the image file, so they will be visible when a users click "Properties" on windows or other OS etc.

Suciu Lucian
  • 430
  • 4
  • 12
  • 2
    This is known as "metadata"; for JPEG images, it is stored in a format called EXIF. Those terms might help you in searching for solutions. – IMSoP Jul 26 '14 at 13:44
  • Possible duplicate: http://stackoverflow.com/questions/5384962/writing-exif-data-in-php – ZeroBased_IX Jul 26 '14 at 13:46
  • Just out of curiosity, why do you want to add that data? If someone copys your picture into e.g. Photoshop and save it, the data is not saved. – putvande Jul 26 '14 at 13:54
  • @IMSoP thank's I did not knew it was called metadata. – Suciu Lucian Jul 26 '14 at 15:27
  • @putvande I want to add all this so I can identify the user in my database in case the pictures are uploaded on other websites. I know the user can remove all my current id's from everywhere but I want to make it as hard as possible from them. Maybe you got a better idea for my problem? – Suciu Lucian Jul 26 '14 at 15:30

1 Answers1

1

The PHP haven't function to write exif data. You must use an external function/class.

You can use :

PEL - PHP Exif Library - A library for reading and writing Exif headers in JPEG and TIFF images using PHP

Or mogrify on command line. See "How do I add exif data to an image?" to use mogrify.

Community
  • 1
  • 1
user2226755
  • 12,494
  • 5
  • 50
  • 73