Dotclear

Ticket #1305 (closed enhancement: fixed)

Opened 14 years ago

Last modified 12 years ago

[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

  1. Go to Blog > Media manager
  2. Choose a file containing EXIF data (Date taken = 2011:01:08 18:45:01)
  3. Click Send
  4. The time used is 2012-01-11 14:35 => NOK
  5. 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

  1. In inc/core/class.dc.media.php, change (line 980)

if ($meta['DateTimeOriginal'] && $cur->media_dt === '')

by

if ($meta['DateTimeOriginal'])

  1. Log out / Log in Dotclear
  2. Remove the existing image
  3. re-run steps 1~5

--> the date used is the one from Exif data => OK

  1. 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:1 Changed 13 years ago by franck

  • Milestone changed from 2.4 to A definir

comment:2 Changed 13 years ago by franck

  • Component changed from module:core to module:mediamanager

comment:3 Changed 13 years ago by franck

  • Status changed from new to onhold

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

comment:6 Changed 12 years ago by franck

  • Milestone changed from A definir to 2.5.1
Note: See TracTickets for help on using tickets.

Sites map