Both currently available methods are too slow for my needs: identify -verbose [filename] | grep -A1 'Profile-ic' and convert [filename] test.icc.
The problem is I don't need the full details of verbose, and I certainly don't need to convert the whole file to test for an icc. I just need to know (quickly!) if it exists so I don't double-apply profiles.
Thanks!
Code: Select all
--- magick/property.c.bak 2013-10-18 13:51:10.000000000 -0500
+++ magick/property.c 2013-10-18 13:51:16.000000000 -0500
@@ -2372,6 +2372,22 @@
image->page.height);
break;
}
+ case 'I': /* presence of icc profile */
+ {
+ ResetImageProfileIterator(image);
+ const char *name=GetNextImageProfile(image);
+ while (name != (char *) NULL)
+ {
+ if ((LocaleCompare(name,"icc") == 0) ||
+ (LocaleCompare(name,"icm") == 0))
+ {
+ (void) FormatLocaleString(value,MaxTextExtent,"%s",name);
+ break;
+ }
+ name = GetNextImageProfile(image);
+ }
+ break;
+ }
case 'M': /* Magick filename - filename given incl. coder & read mods */
{
string=image->magick_filename;