How to find if a file has been edited with IM? (verbose?)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Senos

How to find if a file has been edited with IM? (verbose?)

Post 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!
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: How to find if a file has been edited with IM? (verbose?

Post 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?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to find if a file has been edited with IM? (verbose?

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply