Trouble finding sample ASP and ImageMagick Convert usage.

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
vetrijar

Trouble finding sample ASP and ImageMagick Convert usage.

Post 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.
leww

Re: Trouble finding sample ASP and ImageMagick Convert usage.

Post 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.
Post Reply