Ticket #1305 (closed enhancement: fixed)
[patch] Use EXIF time instead of upload time in Media Manager
Reported by: | Pierre | Owned by: | xave |
---|---|---|---|
Priority: | normal | Milestone: | 2.5.1 |
Component: | module:mediamanager | Version: | 2.4 |
Severity: | normal | Keywords: | media exif upload |
Cc: |
Description
When a user uploads a picture in his Dotclear Media Manager, the EXIF data (time taken) is available, but when the user includes this picture in a post, it is the Upload time that is used in the picture title.
It would be better to use the EXIF data.
This has been discussed in two forum posts (in French): http://forum.dotclear.org/viewtopic.php?id=38734 http://forum.dotclear.org/viewtopic.php?id=45720
I followed tip given by Dsls on a 2.4.1.2 version, and did a Test Case as follow:
Test Case
Date of test: 2012-01-11 14:35
- Go to Blog > Media manager
- Choose a file containing EXIF data (Date taken = 2011:01:08 18:45:01)
- Click Send
- The time used is 2012-01-11 14:35 => NOK
- In the media details:
[Image details] Make: NIKON CORPORATION Model: NIKON D50 Exposure: 10/400 FNumber: 14/10 MaxApertureValue?: 10/10 ExposureProgram?: 4 DateTimeOriginal?: 2011-01-08 18:45:01 ExposureBiasValue?: 0/6 MeteringMode?: 3 FocalLength?: 500/10 (...)
[Change media properties] File date: 2012-01-11 14:35 => NOK
- In inc/core/class.dc.media.php, change (line 980)
if ($meta['DateTimeOriginal'] && $cur->media_dt === '')
by
if ($meta['DateTimeOriginal'])
- Log out / Log in Dotclear
- Remove the existing image
- re-run steps 1~5
--> the date used is the one from Exif data => OK
- re-run steps 1~5 with a picture file without Exif data using jhead for instance:
jhead -purejpg my_picture.jpg --> the file is uploaded using current time as the date => OK
Change History
comment:4 Changed 13 years ago by franck
On peut prévoir un réglage au niveau du blog pour indiquer qu'on préfère la date EXIF (si elle existe) plutôt que la date du fichier, mais ça ne devrait être utilisé qu'au moment de l'insertion dans le billet et pas à l'upload du media.
Il n'y a pas de raison de modifier la date du fichier (qui peut ne pas être, et de façon complètement légitime, la date de prise de vue, par exemple).
comment:5 Changed 13 years ago by franck <carnet.franck.paul@…>
- Status changed from onhold to closed
- Resolution set to fixed
(In [8c279d188ea1]) Media title may now use the EXIF (original) date if exist instead of file date (see blog prefs). Fixes #1305