SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: Re-sizing an image in CFML

  1. #1
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,902
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re-sizing an image in CFML

    Is there a way for me to take an uploaded image (via a form), copy it, and re-size it (not with <img> attributes, actual re-sizing) with CFML?

  2. #2
    SitePoint Addict ownersite's Avatar
    Join Date
    Jul 2001
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not without the use of a custom tag and/or call to an external program using <CFEXECUTE>. On our Linux server, I use a product called Imagemagick for all image manipulation. There are a few custom tags available for the Windows environment at the Allaire Developer's Exchange
    F150online- 102,000 users strong and growing...
    Ownersite.com
    - tools to enhance vehicle ownership

  3. #3
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,902
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dang, I was afraid you'd say that. Know of any custom tags offhand? I'll probably have access to a few programs to use via <cfexecute>, but I have nowhere near the knowledge to write such a custom tag.

  4. #4
    SitePoint Addict ownersite's Avatar
    Join Date
    Jul 2001
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off the top of my head, I think there is a tag named CFX_Image that will resize, create thumbnails, etc. Try searching on the term "resize" at the link I provided and see what you come up with.

    Using Imagemagick with <CFEXECUTE> is really quite easy. For instance, to resize an image to 600 pixels wide (or high), I use the following code (which simply calls a specific Imagemagick application via the command line):

    PHP Code:
    <cfexecute name="/usr/local/bin/mogrify" arguments="-geometry 600x600 /var/tmp/#filename#" timeOut="30"></cfexecute
    F150online- 102,000 users strong and growing...
    Ownersite.com
    - tools to enhance vehicle ownership

  5. #5
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,902
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any experience with ImageMagick on a Windows server? That's what I'll be working with in this case, I think. Oh, and it seems there are lots of tags there for re-sizing -- thanks so much!

  6. #6
    SitePoint Addict ownersite's Avatar
    Join Date
    Jul 2001
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I'm afraid not. But it has worked flawlessly on my Linux box.

  7. #7
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,902
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Argh, I found only one tag, and it's either created with some errors, or was not packaged properly, and it's trying to make use of the <cfx_image> tag, which does not exist, and did not come in the .ZIP file.

    Anyone got any ideas? I'm becoming a bit deperate. Must...make...thumbnails!

  8. #8
    I'm a college yuppie now! sbdi's Avatar
    Join Date
    Jul 2000
    Location
    Dublin , Ireland
    Posts
    1,271
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe you could try and get the custom tag that its looking for? Check the macromedia site.
    Back Again

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •