Compare using COM from VBS returns a null value?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
dmozealous
Posts: 3
Joined: 2011-12-22T14:27:21-07:00
Authentication code: 8675308

Compare using COM from VBS returns a null value?

Post by dmozealous »

Hoping someone can help me out.

This is essentially what I am doing. Using COM to do an image comparison between two images. The problem is myFuzz isn't returning anything when I use COM via VBS. Any idea why? When I do an img.Convert I get a string back, just not with img.Compare.

Set img = CreateObject("ImageMagickObject.MagickImage.1")

myFuzz = img.Compare("-metric","AE", "image1.png", "image2.png", "output.png")

MsgBox myFuzz

Any help would be much appreciated.

Note, the output.png is being created, so I know I am not getting an error.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Compare using COM from VBS returns a null value?

Post by fmw42 »

text comparison results go to standard error. redirect you results to 2>&1. at least that is what I do in command line to put the results into a variable on my Mac/unix
dmozealous
Posts: 3
Joined: 2011-12-22T14:27:21-07:00
Authentication code: 8675308

Re: Compare using COM from VBS returns a null value?

Post by dmozealous »

fmw42 wrote:text comparison results go to standard error. redirect you results to 2>&1. at least that is what I do in command line to put the results into a variable on my Mac/unix
Thanks for the help..

That works great from a command line, but not from the COM component.

Using your suggestion, this is what I changed my script too:

Code: Select all

Set img = CreateObject("ImageMagickObject.MagickImage.1")
myFuzz = img.Compare("-metric","AE", "image1.png", "image2.png", "output.png", "2>&1")
MsgBox myFuzz
This is the equivalent of running this from a command line:
compare -metric AE image1.png image2.png output.png 2>&1

Looks like this guy is having the same problem:
viewtopic.php?f=1&t=17197&start=0
Post Reply