Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resize on display

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
US
I know there are many CF custom tags that allow you to resize images, but are there any that only resize on display?

I want the user to upload the image as normal, but when I <cfoutput> the img, I want to rezise then. Is that doable?

____________________________________
Just Imagine.
 
Yeah but that would distort the image. I don't want to do that. The image resize CFT tags resizes the image without loosing any ratio or distorting the image.

____________________________________
Just Imagine.
 
Thanks for the links guys. I was trying to see if I can find a version for free, but if my client is willing to pay then i'll invest in
The hosting company already has CFX_JpegResize installed, does anyone know if this one resizes on the display?

____________________________________
Just Imagine.
 
Well, my hosting company provides cfx_imagecr so I am using that.

I got the CT to work, but had an interesting observation, and wonder if anyone here can shed some light on this.

Below is my code, in order to have the image resized i had to rename the image as #Product_ID#_resize.jpg, my question is why can't I resize the orignal image using the same name? Now I have a duplicate image (EX: DSP1000.jpg and DSP1000_resize.jpg - the original and the resized one).

Code:
<cfx_imagecr3 load="#request.productimageserver#cell2000/products#thumb#/#extrapath##Product_ID#.jpg" 
save="c:\websites\2v7rgh\cell2000\products\#Product_ID#_resize.jpg"
resize="139x184">
								<img src="#request.productimageserver#cell2000/products#thumb#/#extrapath##Product_ID#_resize.jpg" border=0 vspace=10 alt="#request.productimageserver#cell2000/products#thumb#/#extrapath##Product_ID#_resize.jpg"><br>

Thanks.

____________________________________
Just Imagine.
 
Hmm, i'm still not spotting the issue with Falcon Eye's suggestion, just use only one of the parameters you need, like follows.

Code:
<cfouput>
<img src="#img_url#" width="100px">
</cfoutput>

That way you're always going to be changing the width to your specification but you wont be distorting the image or loosing the proportions of it.

Or am i missing somthing?

Rob
 
<img width="100" />...

yeah, but what about when the image is 800px wide, you're gonna load multiple 800px images to display thumbnails? hope not.

with the other image manip scripts / tags I have used, you can't save a resize as the original. So I would do orig_imagename.jpg or lg_imagename.jpg and delete the imagename.jpg immediatly after a confirmed resize. then I could also make med_imagename.jpg, sm_imagename.jpg, etc..

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
I'm kind of curious why you would want to resize the image on the fly many times over and over again when a user accesses the page, rather than do it once at the time of upload?

Either way you are still going to require storage space, because it has to save the resized image somewhere in either case; and if you do it once at the onset your performance on the system will be much better.

CFX_IMAGE allows you to use tha tag pretty much in either scenario.

jmo/curious
 
"Either way you are still going to require storage space, "

actually you can embed the jpg/gif file in the <img src="" without an image ever existing on the drive. try opening up a small jpg in notepad and copy that into the src="" attribute. used to work in EI at least. haven't tried it in a long time though.

I do agree with you though.



Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
safaritek, that was my original question in the thread. I wanted to know if there were any CT that would allow me to resize the original on display only. Not resize and save the image.

The hosting company (hostmysite.com) has several image resize custom tags available, I chose CFX_imageCR as a short-term solution while I research which CT is best for on-the-fly resize. These are the tags that HMS provides for CF:
____________________________________
Just Imagine.
 
I'm sure you could write some java that would get the temp file after the http upload and resize it, and save it...without using cffile upload at all...

there is a cfx tag that does all the image maip with java only...

I don't know any java!

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top