Page 1 of 1

ImageMagickObject - How To Access STDERR

Posted: 2010-04-18T11:50:55-07:00
by billbell52
I pulled ImageMagicObject source and I am trying to figure out how to modify it to access STDERR. Some IM commands output info to STDERR. Like the compare command outputs location info to STDERR. Example using command line:

compare -metric rmse -dissimilarity-threshold 1 c:\temp\main.bmp c:\temp\sub.bmp c:\result.bmp 2>c:\temp\loc.txt

When using ImageMagickObject I don't see how to access STDERR. Is there a way? Example using ImageMagickObject and Excel VBA:

Sub TestCompare()

Dim imgObj As Object
Dim loc As Variant
Dim mainImage As String
Dim subImage As String
Dim resultImage As String

mainImage = "C:\temp\main.bmp"
subImage = "C:\temp\sub.bmp"
resultImage = "C:\temp\result.bmp"

Set imgObj = CreateObject("ImageMagickObject.MagickImage.1")
loc = imgObj.Compare("-metric", "rmse", "-dissimilarity-threshold", "1", mainImage, subImage, resultImage)
Set imgObj = Nothing
End Sub

Do any developers have any ideas on how to modify ImageMagikObject to enable STDERR to be seen. I studied the code and it was not obvious.