Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / March 2006



Tip: Looking for answers? Try searching our database.

image resizing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
macca242424 - 29 Mar 2006 11:30 GMT
hi i have a image upload area, is there some coldfusion code that i can use to resize image when there are uploaded?
z0ner - 30 Mar 2006 12:06 GMT
check this http://www.jmpj.net/jason/index.cfm?mode=entry&entry=42FE9800-CF1D-76B8-A91A4880
366BE42F

Fernis - 30 Mar 2006 23:31 GMT
I've found CFEXECUTE and ImageMagick (http://www.imagemagick.org/ ) to be
sufficient for most things. In large/heavy-use environments it might be memory
intensive with large images, but I think you'll be happy with it. Also,
CFEXECUTE had some problems with some previous CF editions, but MX 7 seemed to
work flawlessly.

Oh, the blog entry also seems to recommend it. I'll second that. ImageMagick
installation is quite easy, if you host the server yourself.

Use CFUPLOAD to upload the image, CFEXECUTE to call ImageMagick (read
cfexecute documentation _carefully_, especially about timeouts!), optionally
CFCONTENT to preview your image right away (from within the same template) if
you wish (CFFLUSH and HTML <img> could also work). CFFILE is also your friend,
if you want to have a temporary folder where all the images are uploaded
(preferably with unique name, when file name conflicts).

In any case, you need to code some CF. Creating a working, solid file/image
manager isn't a short task for anyone, but it's not very difficult either. Just
takes patience.
macca242424 - 30 Mar 2006 23:49 GMT
ok that sounds good, what if i use a hosting company how would i do this
Abinidi - 31 Mar 2006 15:57 GMT
I would use a CFX tag if you are with a hosting company. There are quite a few
free ones out there that are pretty easy to use.

http://www.kolumbus.fi/jukka.manner/ 
http://www.chestysoft.com/jpegresize/default.asp

CFX_imagecr is one that works quite well with good quality too. Not free
though, but well worth it.

http://efflare.com/
macca242424 - 31 Mar 2006 23:56 GMT
ok many thanks for that i found this free one, using the code below on my
action page, i just get an error though any ideas why this would be

error is
There was an error reading the file.  
File does not exist.  

Code

<cfcache action="flush">
<cfset currentdir=Left(cgi.path_translated, Len(cgi.path_translated) - 12)>
<cfset tempname=CreateUUID()>
<cfset tempfile=currentdir & tempname & ".jpg">
<cffile action="upload" filefield="filesent" destination=#tempfile#>
<cfx_jpegresize action="scale" factor="30" source=#tempfile#
filename=#tempfile#>
<cfcontent type="image/jpeg" file=#tempfile# deletefile="yes">
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.