Page 1 of 1

[SOLVED] Classic ASP: Can IM load from a binary variable?

Posted: 2011-01-03T16:36:29-07:00
by jbc
Hi,

I am successfully using IM with classic asp with outstanding results.

Now, I would like to pass an image to IM in the form of a variable/object instead of a file name.

For example, instead of this: convert rose.jpg rose.png

Can I do this somehow?

1. get a remote image via http [this is done by my script]
2. assign image binary to mybinaryvariable [this is done by my script]
3. convert mybinaryvariable rose.png [not sure how to do this!]

In general I would like to apply the convert command without having to write the image file to disk first.

Many thanks,

JBC

Re: Classic ASP: Can IM load from a binary variable?

Posted: 2011-01-03T17:19:35-07:00
by fmw42

Re: Classic ASP: Can IM load from a binary variable?

Posted: 2011-01-03T17:32:13-07:00
by jbc
Works perfectly, thanks!

For other folks with this question, I did it this way:

Set objIM = Server.CreateObject("ImageMagickObject.MagickImage.1")
strOutput = objIM.Convert("http://www.somewebsite.com/someimage.jp ... eimage.jpg")
Response.Write strOutput
Set objIM = Nothing

JBC