Page 1 of 1

ImageMagickObject Identify not returning output correctly

Posted: 2007-02-27T09:15:51-07:00
by spieler
I have a VBScript file id.vbs

Code: Select all

Option Explicit
Dim oMI
Dim sID
set oMI = createObject("ImageMagickObject.MagickImage")
sID = oMI.Identify ("-ping", WScript.Arguments(0))
WScript.Echo "Output:"
WScript.Echo "_" & sID & "_"
Running this with "cscript /nologo id.vbs rose:" displays

Code: Select all

rose:=>ROSE ROSE 70x46 70x46+0+0 DirectClass 8-bit 9.44531kb
Output:
__
It prints the output at the Identify() step and not the Echo step.
If you run this with wscript instead, the output is not displayed at all.

I'm leaning toward going back to the MagickImage object instead of calling out to the static exes, but this is a bit of a road block.

I just glanced at the code in ATL7/ImageMagickObject.cpp and noticed something different between the two. The declarations are the same, but the implementations are slightly different in that they return different types. Not sure if that's an issue or not.

Code: Select all

  HRESULT  Convert(SAFEARRAY **pArrayVar, VARIANT *pVar);

  HRESULT Identify(SAFEARRAY **pArrayVar, VARIANT *pVar);

STDMETHODIMP MagickImage::Convert(SAFEARRAY **pArrayVar, VARIANT *pVar)
{
  HRESULT hr;
  ...
  return hr;
}

HRESULT     MagickImage::Identify(SAFEARRAY **pArrayVar, VARIANT *pVar)
{
  HRESULT hr;
  ...
  return hr;
}
Thanks,
Gary