John,

Although it takes a high performance hit, if you wanted to do it on the fly,
I have done this with the Alagad Image Component:

<!--- Create the Allagad image component --->
<cfset objImage = CreateCFC("Image") />
                
<!--- Read in the image --->
<cfset objImage.ReadImage(" .... FULL PATH .....") />
        
<!--- Scale the image --->
<cfset objImage.ScaleWidth(URL.thumb_size) />
                
<!--- Write the image data directly to the browser stream --->
<cfset objImage.WriteToBrowser("JPG", 80) /> 


Its nice that the Image component has a write to Browser method for the
binary stream.

.......................
Ben Nadel 
www.bennadel.com
-----Original Message-----
From: Burns, John D [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 25, 2006 12:19 PM
To: CF-Talk
Subject: Image resizing on the fly?

I've been using ImageCR3 to do some image resizing and in the past I've used
imagemagick and alagad's image component. I've always done it where I've
done file resizing at the time of upload. However, I'm facing a situation of
having to display an unknown amount of directories of photos that are being
uploaded into folders via FTP. Rather than forcing someone to go fire off a
page that goes out and does all the resizing, I'm wondering if it would be
feasible to resize the images as needed.
I'm not sure what the overhead would be on something like that. I've seen
some .NET developers doing it with something called image.ashx where they
call their images like <img
src="image.ashx?file=/myfiles/photo1.jpg&width=600&height=400"> and it
appears to just do the resizing everytime someone hits that image. I was
thinking of writing a CFM that did the same thing by resizing the photo and
pass it back to the browser using <cfcontent> but I wasn't sure if the
overhead is too much. This isn't a large site and there won't be a ton of
people hitting it at once, but even 2 or 3 people on there pulling up a page
of 20-30 thumbnails with each image being resized on the fly sounds a little
scary to me. I'm just looking for some more knowledge and expertise on the
subject. Thanks!
 
John Burns
Certified Advanced ColdFusion MX Developer Wyle Laboratories, Inc. | Web
Developer
 
 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238633
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to