[wp-trac] [WordPress Trac] #49414: wp_read_image_metadata should look for timezone offset
WordPress Trac
noreply at wordpress.org
Thu Feb 13 18:07:56 UTC 2020
#49414: wp_read_image_metadata should look for timezone offset
--------------------------+------------------------------
Reporter: dshanske | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Date/Time | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by dshanske):
@joemcgill Well, timestamp has a specific meaning... but the timestamp is
always incorrect because it is converted incorrectly...which is a matter
for the related ticket to improve the conversion function. I proposed
there that it have an extra argument for the timezone offset, which means
the image read function has to search for it more effectively.
Since someone answered the Exif question in that ticket, where I intended
on it only being for modifying the function signature, I answered there.
Newer exif versions allow for a timezone offset. If that property is
there, which I confirmed is readable by exif in PHP, then we should pass
it along and use it to generate the timestamp if we want to keep this for
backcompat
Secondly, exif has multiple date properties...we are using DateDigitized
and storing it as the creation date..however exif has a file creation
date, the date of the original, and the date it was digitized.
DateDigitized is not creation, so we are already misleading in the name of
the property.
In a digital camera photo, original and digital date are the same...we
should be therefore using original date unless blank, in which case,
digitized date. If both are blank, I would give up.
Now we get to the fact that the timestamp is wrong due lack of timezone
offset, we should check for the newer offset fields.. if not present, we
can derive the timezone and adjust the timestamp appropriately by
comparing the timestamp to the gps timestamp property, as that is in UTC.
If the offset cannot be derived from the GPS, if not available, then the
time should assume to be in the site timezone.
I would also suggest that, if we are willing to deprecate storing the
timestamp and maybe even if not, we should store the date in a iso8601
format, which allows for no timezone or timezone in the string
I care a lot more about when I took a picture then when I uploaded it,
which currently displays prominently.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49414#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list