Challenge: I need to parse the output from imagemagick's "identify" command to detect the presence of a particular string. If it doesn't exist, then I echo the filename to the screen.
Background: I have roughly 100k thumbnail images (Example thumbnail that needs to be analyzed). I need to inspect each thumbnail to ensure it was rendered correctly. Luckily, "rendered correctly" can be determined by the presence of red pixels in the thumbnail. Using imagemagick's "identify" command, I can output the colormap which will contain the line, "(255, 0, 0) #FF0000 red".
Need: Using a bash script, I can easily get all the file names and iterate through them. I need to figure out how to silently parse through the output and look for a string match and echo the filename if not found.
Specifically, what I'm looking to do is create a script that does the following:
1) finds all the *.png files in a particular directory.
2) for each file, run "identify -verbose" and silently pass the output to...
3) analyze the output to see if the string "(255, 0, 0) #FF0000 red" exists.
3a) if it does, I continue silently to the next file.
3b) if it does not, I echo the file name.
Ultimately, I'd be left with a short list of thumbnails that did not contain any red pixels and require manual inspection.
Any help creating this script would be most appreciated.