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?
| SitePoint Sponsor |





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?
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





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.
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





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!![]()
No, I'm afraid not. But it has worked flawlessly on my Linux box.





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!![]()





Maybe you could try and get the custom tag that its looking for? Check the macromedia site.
Back Again
Bookmarks