Dynamic Image Resizing

Discussion in 'Programming' started by kory27, Feb 22, 2008.

  1. #1
    Hello. Does anyone have a good solution or code snippet for on the fly image resizing? basically, here is my issue. i have a product feed and the provider gives the url to the image, and the size of the thumbnail. i want to create the thumbnail on my pages by referring to that url and sizes.

    Thanks so much in advance.
     
    kory27, Feb 22, 2008 IP
  2. dshuck

    dshuck Peon

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I am guessing that you haven't read the docs... It is pretty straight forward.

    
    <!--- to get your image into memory --->
    <cfimage action="read" source="./yourpic.jpg" name="ImageObject" />
    
    <!--- now resize it --->
    <cfimage action="resize" source="#ImageObject#"	width="50%" height="35%" name="ImageObject"	/>
    
    Code (markup):
    If you want to send the newly resized image to the browser rather than saving it you can just do this:

    
    <cfimage action="writetobrowser" source="#ImageObject#"	/>
    
    Code (markup):
    Seriously you should try the documentation provided by Adobe sometime. They have information on every tag and every function including code samples:
    Example: http://livedocs.adobe.com/coldfusion/8/Tags_i_02.html
     
    dshuck, Feb 23, 2008 IP
  3. OriKlein

    OriKlein Peon

    Messages:
    171
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i use cfx_image ( search the web for it ) it works like a charm.. I have a site that gets between 20 - 500 images a day and we change them all the thumbnails in one shot.. takes only a few minutes via an automated script in the middle of the night
     
    OriKlein, Apr 20, 2008 IP
  4. apmsolutions

    apmsolutions Peon

    Messages:
    66
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    IMO, cfx_openimage is a little better than cfx_image.
     
    apmsolutions, Apr 30, 2008 IP