Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get image create date in PHP GD

Tags:

php

metadata

gd

I have a case: I took a photo. Now I want to read date of the created photo (the shooting photo date) using GD.

Is it possible to get this date created from the image metadata?

like image 946
Piotr Olaszewski Avatar asked May 11 '26 08:05

Piotr Olaszewski


1 Answers

Use exif_read_data() function instead, you will get everything you'd need :)

http://php.net/manual/en/function.exif-read-data.php

Look for the particular Exif data with a key DateTimeOriginal.

Make sure that the software you are using are not stripping the actual exif. For example if you are using Photoshop, doing a "Save as JPG" retains the exif but "Export for web and devices" does not.

like image 67
Hasin Hayder Avatar answered May 13 '26 22:05

Hasin Hayder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!