>- see footer for list info -<

Can anyone help me with this please?

 

I am trying to upload a picture. Resize it for a thumbnail (Saved in thumbs 
directory), resize the main image file and hopefully overwrite a small 
watermark.

 

I have commented out the water mark bit for now.

 

I am getting an error stating that the directory can not be converted to a 
number.

 

Here's the code.

 

 

<HTML>
<HEAD>
<TITLE>G4CVU NEW</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;">


<cfinclude template="_header.cfm">

<cfset application.uploadDirectory = "c:/inetpub/wwwroot/g4cvu/products">

<!--- Upload File ---> 

  <cffile action="upload"
    filefield ="UploadPic" 
  nameconflict = "overwrite"
  accept = "image/jpg, image/pjpeg"
  destination = "#application.UploadDirectory#">

<!--- Assign name of uploaded ServerFile to svrFile variable --->

<cfset SvrFile = '#trim(file.serverfile)#'>


<!--- Read the Uploaded file to memory and give it a variable name of 
  'mainImage' --->

<cfimage name="mainImage"
  source="#application.UploadDirectory#\#svrFile#" >

<!--- Create thumbnail, note this does not resize the image in memory, 
  just the image that is  written to disk.--->

<cfimage action="resize"
     height="150" 
     width="150" 
     source="#mainImage#"
destination="#application.UploadDirectory\thumbs#\#svrFile#"
     overwrite="true"/>
 <!---    
<!--- Overlay a graphic on the original images ---> 

<cfimage  name="overlay" 
  source="#Application.UploadDirectory#\overlaygrahpic.gif">

<cfscript> 

// Set Anti-Aliasing on for better image quality when rendered
ImageSetAntialiasing(mainImage,"on"); 

// Scale the image so that the width is no larger then 800 pixels square, and
// use the "bicubic" algorithm to interpolate it for performance.
ImageScaleToFit(mainImage,”400”,”400”"bicubic");

// Calculate the X,Y coordinates to place the overlay graphic in the 
bottom right

// corner, with 20 pixels of padding.

x = ImageGetWidth(mainImage) - ImageGetWidth(overlay) - 20; 
y = ImageGetHeight(mainImage) - ImageGetHeight(overlay) - 20; 

// Paste overlay onto main Image
ImagePaste(mainImage,overlay,x,y);

</cfscript>
--->
<!--- Write the processed file to disk ---> 

<cfimage action="write" 
    source="#mainImage#"
destination="#Application.UploadDirectory#\#svrFile#" 
                 overwrite="true" />


<cfinclude template="_footer.cfm">

 

Regards - Paul
                                          
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to