Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Thumbnails

Status
Not open for further replies.

shawntbanks

Programmer
Oct 29, 2003
48
CA
I am looking for some guidence on how to create thumbnails from pictures that are uploaded to my server. I would like this to happen automaticaly. I have 4 pictures being uploaded and I need a thumbnail to go with them for quick display



<CFIF Len(Trim(FORM.picture1)) GT 0 >
<CFFILE action=&quot;UPLOAD&quot; nameconflict=&quot;makeunique&quot; filefield=&quot;picture1&quot; accept=&quot;image/*&quot; destination=&quot;#webRootDirectory##pictureDirectory#&quot;>
<CFSET picture1filename = GetFileFromPath(CFFILE.serverfile)>
</cfif>
<CFIF Len(Trim(FORM.picture2)) GT 0 >


<CFFILE action=&quot;UPLOAD&quot; nameconflict=&quot;makeunique&quot; filefield=&quot;picture2&quot; accept=&quot;image/*&quot; destination=&quot;#webRootDirectory##pictureDirectory#&quot;>
<CFSET picture2filename = GetFileFromPath(CFFILE.serverfile)>



</cfif>
<CFIF Len(Trim(FORM.picture3)) GT 0>
<CFFILE action=&quot;UPLOAD&quot; nameconflict=&quot;makeunique&quot; filefield=&quot;picture2&quot; accept=&quot;image/*&quot; destination=&quot;#webRootDirectory##pictureDirectory#&quot;>
<CFSET picture3filename = GetFileFromPath(CFFILE.serverfile)>
</CFIF>
<CFIF Len(Trim(FORM.picture4)) GT 0>

<CFFILE action=&quot;UPLOAD&quot; nameconflict=&quot;makeunique&quot; filefield=&quot;picture2&quot; accept=&quot;image/*&quot; destination=&quot;#webRootDirectory##pictureDirectory#&quot;>
<CFSET picture4filename = GetFileFromPath(CFFILE.serverfile)>
</cfif>
 
There is great custom tag called cfx_image that is just what you need. You can upload 1 picture and the tag will resize it to whatever height/width you specify, automaticaly create a thumbnail of whatever size you specify, plus a whole lot more! You can get it off of the Developer's exchange


OR


There's also another one called cfx_imageCR that has some of the same features as well.


OR


Hope This Helps!

Ecobb

&quot;Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer.&quot; - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top