For the two of who PM’ed me, I promise, I will get to it this weekend.
Only 2 people, eh? Curious - I’d have expected a deluge. 😊
Question: From what I can see, the script uses the current server time as the photo’s date:
'entry_date' => time()
Is there an easy way to adjust it to use the EXIF data? Looks like it shouldn’t be too hard.
OK, I have attached the module below.
BE WARNED THAT THIS IS VERY ROUGH!!! USE AT YOUR OWN RISK!
It uses your gallery’s upload directory and batch directory.
Install as usual then go to the module to move the files. The images must already be in your batch upload directory. And the upload only puts things in one category, so if you have many images you need to put into many categories it won’t work so well.
Please feel free to modify this code and make it your own. I make no claim on this, so if someone wants to take it and support it or expand it, please do.
Sorry it took so long. The only lines that I changed (IIRC) were line 168 and line 171 of mcp.gallery_batch_uploader.php, to read as follows:
Line 168:
'title' => date('Y-m-d H:i:s', strtotime($exif_datetime['EXIF']['DateTimeOriginal'])),
Line 171:
'entry_date' => strtotime($exif_datetime['EXIF']['DateTimeOriginal']) - 7200 );
For line 168, I formatted the entry title to be a human-readable date/time stamp, in universal format. Feel free to adjust accordingly.
For line 171, I had to adjust the date/time by -7200 to correct a strange time difference I was encountering between the EXIF data and the timestamp used for that picture’s entry in EE. I’ve no idea whether this is a unique thing to my server or photos, or if everyone else will encounter the same thing. I suggest you upload 2-5 pics as a test and see what results you get before using this on a gazillion files.
In case I forgot an alteration I did on any other lines, I’m attaching the files themselves to this post.
Thanks once again for this script, Erin - it’s been a MASSIVE help! 😊
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.