Page 1 of 1
How to find if a file has been edited with IM? (verbose?)
Posted: 2010-12-07T22:07:56-07:00
by Senos
Im making an application in C++ (Qt) to process a batch of Image files.
Is there any way to check if the file has been edited by ImageMagick before?(by checking the actual file)
I was thinking that If I can write into metadata, then I will be able to read(verbose) and avoid processing the same file for second time.
Has anyone tried something similar ?
any Ideas ?
Thank you!
Re: How to find if a file has been edited with IM? (verbose?
Posted: 2010-12-08T00:50:00-07:00
by GreenKoopa
There are endless ways to do this.
External - keep a list of filenames or file hashes or image fingerprints
File level - alter the filename, directory, or use file system metadata (would depend on your file system)
Image - set a single pixel or some more complex watermark - maybe your processing already leaves a detectable mark
And yes, set image metadata. The first question you should address is which of these broad options best meets your needs. If you do decide to store information within the image file, do you know what formats you need to support? Or what metadata already exists? You could set the comment, unless you already have image comments you need to preserve. I believe ImageMagick can read EXIF and IPTC, but I don't know how to write to them.
You said you were using C++. So you are using the Magick++ interface, or calls to the command-line interface or some other interface?
Re: How to find if a file has been edited with IM? (verbose?
Posted: 2010-12-08T02:56:59-07:00
by anthony
if you do want to store meta-data in the image you will first need to see what meta-data that image format can take.
Montage examples looks at this -- a little bit -- that is saving labels, comments and caption strings
and then seeing if Im can see them when it again reads the file.
http://www.imagemagick.org/Usage/montage/#label
Other than using existing meta data strings, the only other way is to create a profile of some kind, if that file format allows.