ImageMagickObject Identify not returning output correctly

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
spieler
Posts: 47
Joined: 2004-10-08T09:03:16-07:00
Location: Iowa

ImageMagickObject Identify not returning output correctly

Post by spieler » 2007-02-27T09:15:51-07:00

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

Post Reply