Make WordPress Core

Opened 11 years ago

Closed 5 years ago

#14137 closed enhancement (wontfix)

EXIF tag DateTimeDigitized not always present

Reported by: MMN-o Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.0
Component: Upload Keywords: has-patch
Focuses: Cc:

Description (last modified by nacin)

Shooting images with my Nokia N900 will only fill in EXIF data for "DateTimeOriginal", not the tag "DateTimeDigitized" which Wordpress solely uses.

Grabbing data from DateTime and/or DateTimeOriginal would increase the amounts of correct EXIF date data collected when uploading images.

Attaching sample original image from my camera. CLI tool 'exif' when grep:ed with 'Date' outputs the following for the attached image:

Date and Time       |2010:06:25 15:47:14
Date and Time (origi|2010:06:25 15:47:14

'exif --list-tags *jpg|grep Date' results in the following (* meaning data exists):

  0x0132 Date and Time                   *      -      -      -      -   
  0x9003 Date and Time (original)        -      -      *      -      -   
  0x9004 Date and Time (digitized)       -      -      -      -      -  

wp-admin/includes/image.php has the function which retrieves this metadata.

Attachments (1)

14137.diff (976 bytes) - added by Otto42 10 years ago.
Patch to use DateTimeOriginal and/or DateTime in preference to DateTimeDigitized

Download all attachments as: .zip

Change History (16)

#1 @MMN-o
11 years ago

File not attached, but linked here:

#2 @MMN-o
11 years ago

  • Keywords DateTime added

#3 @MMN-o
11 years ago

  • Keywords image added
  • Summary changed from EXIF DateTimeDigitized not always presented to EXIF tag DateTimeDigitized not always present

#4 @nacin
11 years ago

  • Description modified (diff)

#5 @nacin
10 years ago

  • Cc miqrogroove@… added
  • Keywords needs-patch added; n900 DateTimeDigitized DateTime DateTimeOriginal EXIF camera image removed
  • Milestone changed from Awaiting Review to Future Release

No issues adding the extra field here.

#6 @miqrogroove
10 years ago

Ah, nice ticket. This could be patched up in an hour or two. I would first want to see why there are three different date fields and whether all three should be recognized instead of just one or two. I simply have zero time to devote as I'm back in school with five papers due by mid Nov.

#7 @MMN-o
10 years ago

Great that someone woke this ticket to life. I had no means whatsoever when I posted it to delve into the issue, but I'll give it a shot now if miqrogroove doesn't make it first :)

It seems DateTimeDigitized tells us when an image was digitized, as opposed to DateTimeOriginal which tells us when it was originally _created_. That is, an analog picture which was scanned should have different DateTimeOriginal and DateTimeDigitized, whereas a digital still image reasonably has identical timestamps.


The priority list for Wordpress to interpret EXIF timestamp should be:

  1. DateTimeOriginal (This is when the image was first created. Should override everything.)
  2. DateTime (I'm guessing this is most common, and more likely to represent correct time than digitization)
  3. DateTimeDigitized (if no other data is available, assume digitization equals time of creation)

#8 @miqrogroove
10 years ago

I looked up and confirmed 0x132 DateTime represents the time of the last edit. It is not the correct value to assign to $meta['created_timestamp'].

There may be no significant distinction between the Digitized and Original fields, so I would favor Digitized and fall back on Original for consistency. The camera in question appears to be out of compliance with Exif.

10 years ago

Patch to use DateTimeOriginal and/or DateTime in preference to DateTimeDigitized

#9 @Otto42
10 years ago

  • Keywords has-patch added; needs-patch removed

In looking through some photos, I found DateTimeOriginal and DateTimeDigitized generally contained the same values, and either one or the other existed.

For simplicity, I say we favor things in the order given by MMN-o. Patch does just that.

#10 @miqrogroove
10 years ago

I still disagree with the idea of changing this behavior such an arbitrary manner.

#11 @Otto42
10 years ago

Well, I could compile some stats and such across the whole of the internet if you liked, but in the ones I checked via my totally non-scientific sample, there was no "DateTime", but "DateTimeOriginal" and "DateTimeDigitized" were fairly commonplace.

"DateTimeOriginal" has been around a long time.
"DateTimeDigitized" has been around since digital cameras got to the point of non-suck.
"DateTime" doesn't exist as far as I've seen. But I admit that I didn't try very hard to find it.

The order is irrelevant, as I see it. Choose your own and I'll back it. But it should definitely check for more than one of them.

#12 @miqrogroove
10 years ago

  1. DateTimeDigitized
  2. DateTimeOriginal

#13 @Otto42
10 years ago

Given the same general principle as I stated in #16251: "the attachment post is the representation in WordPress of the attachment file", then it makes more sense for the "Original" date to be assigned to the created_timestamp, over the "Digitized".

That said, in practice, it probably doesn't make any difference at all in the grand scheme of things. The number of cases where Original is different than Digitized is probably capable of being counting on fingers.

#14 @chriscct7
6 years ago

  • Keywords dev-feedback added

#15 @wonderboymusic
5 years ago

  • Keywords dev-feedback removed
  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

5 years, no drama - let's just close it

Note: See TracTickets for help on using tickets.