+profile syntax in Vbscript

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
cmcfarling
Posts: 14
Joined: 2003-12-23T12:39:53-07:00
Contact:

+profile syntax in Vbscript

Post 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?
spieler
Posts: 47
Joined: 2004-10-08T09:03:16-07:00
Location: Iowa
Contact:

Re: +profile syntax in Vbscript

Post 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.
cmcfarling
Posts: 14
Joined: 2003-12-23T12:39:53-07:00
Contact:

Re: +profile syntax in Vbscript

Post 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.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests