All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
ImageMagick Help
Hi all. I know this isn't a server related help subject, but I know you guys are very clever and thought I could run something by you.
I have a folder full of images (thousands) that cannot be moved or renamed as they're linked to a database which has their full UNC paths.
I need to date/time stamp each image using the 'photo taken' data in the EXIF data of each file. I have found the correct command with ImageMagick, which is:
convert testimage.jpg -font Arial -pointsize 42 -fill white -annotate +30+50 %[exif:DateTimeOriginal] testimage.jpg
This command only amends one image at a time though (testimage.jpg in this example). I need to run this for all photos in the folder as a first step, then incrementally apply the command to each new file that is created.
Around 50-150 images are being created and sent to this folder each day, and I need to be able to identify only new files and apply a timestamp command to only those files (i.e. not all 10,000 files in the folder, most of which will have already been timestamped).
Any ideas? I hoped something could be done with batch scripting as this will ultimately sit on a Windows server doing its thing.
Thanks.
Comments
If PHP is an option you could use exif_read_data() and loop through your files.
does every file in your directory - what are your options for tracking the files you've already done?
Just doing a little more digging on Google I have found this command to use in powershell (doesn't work in cmd apparently):
This returns a list of files that have had the file modified in the last day. Ideally i'd like it to look at the create date, but we'll go with this.
How can I implement this into the batch file?
Think I've got it:
forfiles /S /D +0 /c "cmd /c convert @FILE -font Arial -pointsize 42 -fill white -annotate +30+50 %[exif:DateTimeOriginal] @FILE"
Use mogrify and to find new files perhaps change the group of the file ?
Afaik there's no way to check a files creation date so you couldn't search for all of yesterdays files and apply the timestamps only to those files. I'm guessing your best bet would be to keep a running tally of filenames that you've already applied your timestamp to. You could then check to see whether it was already modified and if not, do your ImageMagick stuff.
Assuming all your images are jpg files, maybe something like this?