[wp-trac] [WordPress Trac] #49413: wp_exif_date2ts should use Dateatime and accept an optional offset

WordPress Trac noreply at wordpress.org
Wed Feb 12 20:50:31 UTC 2020


#49413: wp_exif_date2ts should use Dateatime and accept an optional offset
--------------------------+------------------------------
 Reporter:  dshanske      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  low           |   Milestone:  Awaiting Review
Component:  Date/Time     |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by dshanske):

 @skithund I added a filter to read_image_metadata that dumped the exif
 from a jpeg from my phone to a file for testing...and regrettably you are
 wrong. The data did come out.

     "ExifVersion": "0231",
     "DateTimeOriginal": "2020:02:08 20:31:08",
     "DateTimeDigitized": "2020:02:08 20:31:08",
     "UndefinedTag:0x9010": "+02:00",
     "UndefinedTag:0x9011": "+02:00",
     "UndefinedTag:0x9012": "+02:00",
     "SubSecTime": "190673",
     "SubSecTimeOriginal": "190673",
     "SubSecTimeDigitized": "190673",
     "GPSTimeStamp": [
          "18\/1",
          "31\/1",
          "8\/1"
      ],

 Now, the EXIF 2.32 standard defines that as

 9010 - Offset Data of DateTime
 9011 - Offset Data of DateTimeOriginal
 9012 - Offset Data of DateTimeDigitized
 SubSec is subseconds attached to those same fields.
 DateTimeOriginal - Date and time original was made,
 DateTimeDigitized - Date and time it was digitized
 DateTime - File Change and Date Time

 And The GPS Timestamp and GPS DateStamp indicates the time as UTC
 (Coordinated Universal Time). TimeStamp is expressed as three RATIONAL
 values giving the hour, minute, and second....which means we could try to
 use that to derive a correct timestamp

 DateTimes are expressed in format "1997:09:01 12:00:00"

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49413#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list