auto resize image?

Discussion in 'Programming' started by cfnut, Apr 30, 2007.

  1. #1
    I am having a problem with images that vary in size. I let the user upload images and then display it on a web page. The problem is that the images that the users submit are different sizes. Some look good while others look distorted. Currently I just use a fixed size like 200 x 150. If this is not a ColdFusion question I am sorry. Any Ideas?

    Thanks,
    JN
     
    cfnut, Apr 30, 2007 IP
  2. jazz7620

    jazz7620 Banned

    Messages:
    357
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I know how to do it in php...
    Basically you mark down the image in width (if that needs to be constant) and get the factor and mark down the height proportionately.
     
    jazz7620, Apr 30, 2007 IP
  3. cfnut

    cfnut Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I don't really now PHP very well and I am not sure the it is supported in the plan that I have with my webhost. Can't this be done in coldfusion?
     
    cfnut, Apr 30, 2007 IP
  4. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    There are a lot of pre-made custom tags and cfcs for resizing images. Its a common request so check with your webhost about what options they support: custom tag or cfc. They may even have something set up already.

    Here are two options, but there are many others.

    http://www.opensourcecf.com/imagecfc/
    http://www.kolumbus.fi/~kr0626/cfx_openimage/
     
    cfStarlight, Apr 30, 2007 IP
  5. IsRoss()

    IsRoss() Peon

    Messages:
    116
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    or just wait for CF8 & it's CFIMAGE tag! (all types of real time image manipulation & creation, including on-the-fly CAPTCHAs) :)
     
    IsRoss(), May 1, 2007 IP
  6. senloong

    senloong Peon

    Messages:
    102
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i need the same resizing solution too and wonder when CF8 will be released
     
    senloong, May 2, 2007 IP
  7. IsRoss()

    IsRoss() Peon

    Messages:
    116
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    It will be mid-2007. There is a popular custom tag that can accomplish this. Just google CFXImage.
     
    IsRoss(), May 3, 2007 IP
  8. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    > or just wait for CF8 & it's CFIMAGE tag

    Its about time! Now I can't wait to try CF8 :)
     
    cfStarlight, May 3, 2007 IP