Announcement

  •  » Requests
  •  » Field "Creation date" should be extracted from representative image

#1 2013-01-08 13:25:48

svenwerlen
Member
2013-01-08
6

Field "Creation date" should be extracted from representative image

Hi all,

I've been using Piwigo for many years to share pictures with my family. I love this gallery and would take the opportunity to thank the whole team for it.

I recently decided to upgrade my gallery to the latest version which supports mobile devices and provides new features. I also decided to add my videos to the gallery using the videojs plugin. I worked on some improvements that I'll contribute soon but I'm missing one feature in Piwigo that I cannot figure out to implement. With this request, I would like to ask for some help to identify how to implement it.

I'm using the FTP synchronization to upload my videos (and pictures). For videos, I realized that the "creation date" always remains non set (null). Because of that the videos always appear at the end of an album. I would like them to be mixed with pictures, sorted by creation date.

If I set the "creation_date" in the database, Piwigo doesn't show it while displaying the picture but everything works as expected (sorting, filter by creation date, etc.). That would be sufficient for me.

I first tried to set ID3 and other tags on the videos but videos are difficult to manipulate and I don't think that Piwigo is trying to read them anyway.

Since Piwigo can host different type formats (.avi, .ogv, .doc, etc.) and provide the possibility to define a representative image, I think that the best way to fix the problem would be to extract the metadata for non-image files from its representative. I alreay have a python script that automatically generates representative images from my videos and "inject" metadata.

I'm looking for some help to identify which PHP class/function is responsible for the handling of representative.

Many thanks in advance.

Sven

Offline

 

#2 2013-01-08 20:25:02

rvelices
Piwigo Team
2005-12-29
1960

Re: Field "Creation date" should be extracted from representative image

This is what it should already do ...

Code:

function get_sync_metadata($infos)
...
  $file = PHPWG_ROOT_PATH.$infos['path'];
...
  if (isset($infos['representative_ext']))
  {
    $file = original_to_representative($file, $infos['representative_ext']);
  }
...
$exif = get_sync_exif_data($file);

Offline

 

#3 2013-01-11 13:11:14

svenwerlen
Member
2013-01-08
6

Re: Field "Creation date" should be extracted from representative image

After some testing, it indeed works as expected with representative in .jpg format but not with .png. I used the same EXIF metadata in both and for some reasons, metadata is not properly extracted from PNG. Anyway, it's not very important because I'm generating now JPG rather than PNG and it works.

Thanks for your help!

Offline

 
  •  » Requests
  •  » Field "Creation date" should be extracted from representative image

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact