Coldfusion Image Resizer w/ tmt_img.cfc

More late night code obsession....

I have had Massimo's tmt_img.cfc at the root of my CF cms, dynamic cfGallery and other apps for quite a while.... but I hadn't ever set it up as a standalone process... until now.

http://mredesign.com/cfdev/UploaderMREdemo/index.cfm


This simple demo lets the user input the thumb and full size widths of their choice, and uploads the original file for safekeeping. Also, any spaces in the filename are replaced with hyphens to avoid troubles later on.

Another thing I have been wanting is dynamic paths... this whole thing runs on CGI variables that get and show the server path and the http url based on the location of the upload page (and a few set folder names, in relative locations). This means you can place it anywhere and it will 'know' where it is with no entry of server or http info.

tmt_img can also crop, get dimensions, and more... but this shows the basic function and it was fairly easy to set up, once I got the syntax right.

EDIT: Files are attached to this post. See the 'download' link below.
You will need a copy of tmt_img... get it here... then unzip my attachment and put the tmt_img file into the 'tags' directory, then upload the works to anwhere on your CF server. It *should* work.  (Then again, it is *almost* 5 am, so anything is possible... )

Related Blog Entries

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
I am having issues uploading files larger than 400kb, is there a way I can raise that max of 1mb to something closer to 4mb?

Also, I attempted to replace both 'overwrite' functions with 'makeunique' so the files are diffrent, but no success, any ideas?

P.S. Thanks for an amazing script btw. :),
# Author Josh L | 10/8/07 4:32 AM
@josh: You should be able to change the max upload size right in the code (if I even actually have it throttled... not sure, might have just been a text 'suggestion' ). Also, afaik 'makeunique' should work just fine, simply by changing the statement in the cffile as you say you have.
# Author Michael Evangelista | 10/8/07 7:35 AM
Turns out the max upload size wasn't the issue, apparently there is something when uploading files that were taken out of iphoto Which is totally weird. I took the same original file, put one through psd, and the 2nd through iphoto, put them both on the desktop and uploaded, the iphoto one caused the script? to time out.

I am still trying to figure out why makeuniqe isn't working though, it seems to only like overwrite.
# Author Josh L | 10/12/07 12:01 AM
I figured it out, :)
Thanks again for the script.
# Author Josh L | 10/12/07 12:42 AM
>> I figured it out, :)

what was it?
# Author Michael Evangelista | 10/12/07 7:58 AM
blogcfc 5.9.1.002 by raymond camden
contact michael evangelista