Stream image straight to browser

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

Stream image straight to browser

Post by Andy »

Does anybody have example asp code for streaming converted image straight to the browser without creating a second file.

Thanks
Andy

Re: Stream image straight to browser

Post by Andy »

Hmmm...great product shite community support.

I've found out it's done. If anybody is interested let me know.
Andy

Re: Stream image straight to browser

Post by Andy »

<%
response.contenttype = "image/JPEG"
fileName = request.queryString("fileName")
size = request.queryString("size")
extent = request.queryString("extent")
Set img = Server.CreateObject("ImageMagickObject.MagickImage.1")
dim image2(2)
image2(0)="JPEG:"
msg = img.convert("-trim","-resize",size,"-extent",extent,"-gravity","center","d:\productImages\"+fileName, image2)
response.expires = 0
response.buffer = true
response.binarywrite(image2)
response.end()
set img = nothing
%>
Post Reply