Using Identify in VBA

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
oddball508

Using Identify in VBA

Post by oddball508 »

Does anyone have any ideas on why this code does not work? Doing this by command line works. I have the current version of IM loaded and set in the references.

Dim imgobj As MagickImage
Dim strDPI As String
Dim strFile As String

strFile = "J:\RCTAPE\AWM4\Jpeg\26\9\19\0001.jpg"

Set imgobj = New MagickImage
strDPI = imgobj.Identify("-format", "%x", strFile)
Set imgobj = Nothing
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Using Identify in VBA

Post by el_supremo »

Does anyone have any ideas on why this code does not work?
It might help if you'd said what it was doing wrong. Error message? Nothing at all?

However, if this was C, I would say that you have to escape the backslashes in the filename string:

Code: Select all

strFile = "J:\\RCTAPE\\AWM4\\Jpeg\\26\\9\\19\\0001.jpg"
I'm not certain but I think Basic needs the same thing.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
oddball508

Re: Using Identify in VBA

Post by oddball508 »

Thanks - good point on the error message. It was a run-time error of "operating system exception". But the problem looks like it is in the current vertion of IM (ImageMagick-6.4.8-9-Q8-windows-dll). I rolled back to version 6.4.0-6-Q8 and it works perfectly.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Using Identify in VBA

Post by magick »

Install the Microsoft Visual C++ 2008 Redistributable Package. That will most likely solve your problem.
oddball508

Re: Using Identify in VBA

Post by oddball508 »

Thanks - I'll try that one later. But why would installing the Microsoft Visual C++ 2008 Redistributable Package help with a VBA utilisation?
Post Reply