Page 1 of 1

Trouble finding sample ASP and ImageMagick Convert usage.

Posted: 2008-07-27T12:12:55-07:00
by vetrijar
I've been trying to research the ImageMagickObject usage with ASP and cannot find any examples of how to access anything, nor how to actually get the object functions. The only thing I have found is:

Code: Select all

Set mObj = Server.CreateObject("ImageMagickObject.MagickImage.1")
After that, I cannot find any code other than Perl and such. Does anyone have a website or place (or better just post a sample code) where I can see how to use the Convert feature??

I'm using this on a shared hosting web server at http://www.aplus.net in which they support the imagemagickobject with asp and state people use it, but they cannot give me any info on how to access it other than going to the IM website.

.. and there I still just find perl, c++ style scripts only. no ASP.

Re: Trouble finding sample ASP and ImageMagick Convert usage.

Posted: 2008-08-14T12:59:30-07:00
by leww
Here's an example from our code where we're largely making thumbnail JPEGs out of TIFFs. It assumes the ImageMagick Com object is "img"

Code: Select all

strSourceFileNameIncludingPath = "d:\source\Source.TIF"
intQuality = "85"
strSizeBox = "150x150>"
strTargetFileNameIncludingPath = "d:\Website\Target.JPG"

strMessage = img.Convert(strSourceFileNameIncludingPath, "-quality", intQuality, "-colorspace", "rgb", "-resize", strSizeBox, strTargetFileNameIncludingPath)
With ASP be sure your IUSR_machinename has the appropriate read and write permissions in the source and target directories and in the TMP/TEMP directories set in your environment variables (or MAGICK_TMPDIR set)

The key appears to that the command line variables follow the source file name and are passed as a comma separated set of strings.