5 Replies Latest reply on May 14, 2007 8:12 PM by turtle7

    croping and scaling

    Level 7
      I have a website where a user enter a customize of the graphic they want...
      then I show them the picture with a highlight of the size they select

      example: customize size: 20 x 20
      show them a picture with a 20 x 20 box over the actual images.
      but the user now wants to scale the image (while still keeping the 20 x 20
      size) wants to

      the website this is on right now is build in PHP.. and I'm wondering if I
      can just point out to a cf page that will allow the cropping/scaling and
      then go back to PHP with the data?

      if someone knows how to do this; I'm will to pay to get it

        • 1. Re: croping and scaling
          Level 7
          currently available cf versions do not have built-in image manipulation
          support. you can do it, but you need to either use external tools or go
          into Java classes. the upcoming CF8 will have a <cfimage> tag that will
          allow image manipulation.

          since your site is built with php, i suggest you search for available
          php solutions - there are plenty out there, many free.

          Azadi Saryev
          Vientiane, Laos
          • 2. Re: croping and scaling
            turtle7 Level 1
            I use imageMagick ( http://www.imagemagick.org) for creating thumbnails and resizing images. It's free and can handle a fair amount of image formats

            for example, to resize an image I would do the following,

            first, create a .bat file, createResized.bat:
            convert.exe %1 -resize 800x800 %2

            then, in your code
            <cfset string1 = '/C C:\whatever\createResized.bat "#vNewFileName#" "#vNewFileNameResized#"'>
            <cfexecute name="cmd" arguments="#string1#" timeout="180"></cfexecute>

            this is how I would resize something to not be greater than 800 pixels in any direction for example

            • 3. Re: croping and scaling
              turtle7 Level 1
              I can't remember why I use .bat files instead of just calling the executable directly. It was a long time ago that I wrote this and I remember I ran into some kind of trouble, but perhaps that was just due to inexperience at the time.
              • 4. Re: croping and scaling
                Level 7
                i use imageCFC from opensourcecf.com. a great little thing that does not
                require any extra dll's to be installed and can perform lots of tricks...
                check it out at:

                Azadi Saryev
                • 5. croping and scaling
                  turtle7 Level 1
                  ImageMagick is a better solution for a PHP site - it is the image utility used by mediawiki (the backend software of wikipedia) and countless other PHP packages. It seems pointless to point a PHP page to a coldfusion site just for image resizing.

                  If you have a coldfusion site, and imageCFC supports the formats and features you want, then it probably is the best option in terms of integrating neatly into your code.

                  If the feature set / format support of imageCFC is not sufficient for what you're doing (as it wasn't for me), then calling ImageMagick from Coldfusion can also be achieved relatively easy, and it is a very mature and feature rich set of tools.

                  Just to be clear, ImageMagick doesn't require installation / DLLs. - the executable files just need to be somewhere the Coldfusion server can do a CFEXECUTE on them and it has support under linux as well.