Page 1 of 1

+profile syntax in Vbscript

Posted: 2010-07-20T11:09:04-07:00
by cmcfarling
I need to remove all profiles from the output file except the ICC profile. This works fine from the command line:

convert "E:\test1.tif" -profile "C:\Profile1.icc" -profile "C:\Profile2.icc" +profile "!icc,*" E:\test1.jpg

As you can see, since there are two parameters assigned to the +profile command they must be enclosed in quotes.

Trying to accomplish this with the ImageMagickObject from vbscript however is presenting a problem.
None of the following example work, all profile data is retained.

Code: Select all

sReslt = oIM.Convert("E:\test1.tif","-profile=C:\Profile1.icc","-profile=C:\Profile2.icc","+profile=!icc,*","E:\test1.jpg")

sReslt = oIM.Convert("E:\test1.tif","-profile=C:\Profile1.icc","-profile=C:\Profile2.icc","+profile=""!icc,*""","E:\test1.jpg")

sReslt = oIM.Convert("E:\test1.tif","-profile=C:\Profile1.icc","-profile=C:\Profile2.icc","+profile=""!icc" & Chr(44) & "*""","E:\test1.jpg")

Note that if I use just the wildcard and remove all profiles it works fine (...,"+profile=*",...). So the comma is what's messing things up, but how do I overcome this?

Is there something simple I'm overlooking here?

Re: +profile syntax in Vbscript

Posted: 2010-07-20T12:18:08-07:00
by spieler
Each item needs to be a different parameter in your function call. I did not test the following, but it should go something like

Code: Select all

sReslt = oIM.Convert("E:\test1.tif","-profile","C:\Profile1.icc","-profile","C:\Profile2.icc","+profile","!icc,*","E:\test1.jpg")
All on one line of course.

Re: +profile syntax in Vbscript

Posted: 2010-07-20T14:20:15-07:00
by cmcfarling
Well that didn't work at first either, I was still getting the same results. Apparently though the ImageMagickObject.dll that was in use was from a previous install (v6.3.7) even though v6.6.3 was installed. After uninstalling everything and reinstalling 6.6.3, the comma delimited syntax that you pointed out is working.