I am exploring the idea of tying into ‘gallery_cp_insert_entry_end’.
I would like to get the EXIF data for the uploaded image, and then set the images date field to the ‘datetimeoriginal’ date in the EXIF data.
That way when I sort my gallery, it will be sorted by the date the image was taken, not the date is was uploaded.
To make my life easier I was hoping to call Lodewjik’s EXIF plugin to get the data. Is this possible?
Hey Erin,
Depending on how Lodewjik’s functions work you may be able to use his plugin as a class within your extension.
You could call his plugin inside an extension function like this:
if ( ! class_exists('Exif'))
{
require PATH_PI.'pi.exif'.EXT;
}
$EXIF = new Exif();
Then any functions you wanted to use could be called like this:
$EXIF->function();
However, his functions may rely on getting data from the $TMPL class and if thats the case then this may not work out for you. In that case you could alway ask him if he is averse to you using pieces of his code within your own extension instead of calling it straight from the plugin like this.
Jamie
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.