在PHP GD中获取图像创建日期 [英] Get image create date in PHP GD
问题描述
我有一个案例:我拍了张照片.现在,我想使用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?
推荐答案
改用exif_read_data()函数,您将获得所需的一切:)
Use exif_read_data() function instead, you will get everything you'd need :)
http://php.net/manual/en/function. exif-read-data.php
使用键DateTimeOriginal查找特定的Exif数据.
Look for the particular Exif data with a key DateTimeOriginal.
确保所使用的软件没有剥离实际的exif.例如,如果您使用的是Photoshop,则执行另存为JPG"会保留exif,但不会保留导出为Web和设备".
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.
这篇关于在PHP GD中获取图像创建日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!