Page 1 of 1

Stream image straight to browser

Posted: 2008-02-13T08:35:21-07:00
by Andy
Does anybody have example asp code for streaming converted image straight to the browser without creating a second file.

Thanks

Re: Stream image straight to browser

Posted: 2008-02-14T06:49:44-07:00
by Andy
Hmmm...great product shite community support.

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

Re: Stream image straight to browser

Posted: 2008-02-20T06:35:29-07:00
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
%>