Page 1 of 1

Getting Started - a newbie's take

Posted: 2010-12-22T16:02:29-07:00
by compbrat75
Helpful Information from one Newbie to another on Getting Started

I didn't have much fun or much luck finding all of this information when I needed it. So I thought others might need it in the future and decided to put it together.

My environment: Windows 7, Classic ASP, VBScript

Installation:
Problem: Partial Installation, not working from the command line (cmd)
Solution: Ran the installation again using 'Run as administrator' (If it still doesn't work, I'd log into the generic administrator account on the computer/server and repeat the process.)

Problem: Worked great from the command line, but couldn't get the object created in ASP 'Server.CreateObject Failed'
Solution: Manually registered the DLL through the command line: regsvr32 "C:\Program Files\ImageMagick-6.6.6-Q16\ImageMagickObject.dll"

Problem: ASP page executed without errors, but the image didn't convert
Solution: the IUSR for the computer/server must have permission to read and/or write on the directories of the old image, the new image, and the computer's/server's default TEMP/TMP directory


Basic Information (each example build on the previous)

Creating the Object in Visual Basic Script

Code: Select all

	Dim img
	Set img = Server.CreateObject("ImageMagickObject.MagickImage.1")
Simple conversion from one type to another

Code: Select all

img.Convert "fullpathtoimage", "fullpathtonewimage"

OR

Code: Select all

Dim origImg, newImg, msgs
	origImg = "C:\someimage.jpg"
	newImg = "C:\someimage.gif"
	
	msgs = img.Convert(origImg, newImg)

Find out information about an image

Code: Select all

Dim format, imgHeight, imgWidth, imgFileSize, imgMultipleProperties
	format = img.Identify("-format", "%m", origImg)

(Output should be the type of image/file: GIF, JPEG, PDF etc)

Code: Select all

imgHeight = img.Identify("-format","%h", origImg)
	imgWidth = img.Identify("-format","%w", origImg)
	imgFileSize = img.Identify("-format", "%b", origImg)
	imgMultipleProperties = img.Identify("-format", "%wx%h, %b", origImg)


For a complete list of available keywords: http://www.imagemagick.org/script/identify.php
For a complete list of properties (the %letters...):http://www.imagemagick.org/script/escape.php

I hope that this helps others. :)

Re: Getting Started - a newbie's take

Posted: 2011-01-28T08:59:44-07:00
by PeterCzerna
I cannot register the ImageMagickObject.
- I am using Win 7 64bit
- ImageMagick-6.6.7-Q16 installed from ImageMagick-6.6.7-3-Q16-windows-x64-dll.exe.
- The auto registration during install failed (silently...)
- Manual registration from the command prompt as Administrator gives the following error message:

"The module "ImageMagickObject.dll" may not be compatible with the version of Windows that you are running..."
Both versions of regsvr32.exe produce the same message.


:(