Rick-

I agree and that's what I'm leaning toward. The only thing I don't like
is that if I want to change dimensions of all the images for some
reason, I have to go back through and run everything over again. The big
thing that prompted this question was that I saw .Net people using
image.ashx (do a google search on it) and it seems they do it on the fly
everytime. I'm not sure if .net is just better at doing it with very
little overhead or if the people doing it are a timebomb waiting to
explode on their server if they ever get significant traffic. 


John Burns
Certified Advanced ColdFusion MX Developer
Wyle Laboratories, Inc. | Web Developer
 

-----Original Message-----
From: Rick Root [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 25, 2006 1:16 PM
To: CF-Talk
Subject: Re: Image resizing on the fly?

John,

Since you don't want to always be resizing on the fly every time someone
views an image, you might try something like this:

<img src="showImage.cfm?foo=myImage.jpg">

and in showImge.cfm just use imageCFC to read the image dimensions.  If
the image hasn't been resized, resize it and save it back.  Then use
<cfcontent> to send the image.

That way every time you display the image, the only added overhead would
be getting the image dimensions.

ALTERNATIVELY, save the resized image with a different filename like
"myImage_resized.jpg" and then have showImage.cfm check for the
existence of the file - if it's not there, resize the original image and
save it.

Then you're not even calling java to get image dimensions, you're only
checking for the existence of a file with a specific name.

ultimately, you're better off not doing any of this dynamic stuff cuz it
won't scale.  You'd be better off using some kind of event gateway
directory watcher and just resizing the images as they appear.

rick



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238791
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to