resizing jpgs
I have the resizing working fine, but there is a glitch somewhere and I am writing to find out if anyone else has had this issue. I am making a resizing function for a admin in a shopping cart to resize the photo into the store. It works fine with all images, but only if I resave them through photoshop first. I am not sure if there is a issue with the raw camera format or what. However, it has an issue with images saved from the web. Seems to work just fine once a save in photoshop in the "save for web and devices" menu. here is the code....the top will not make sense , but i believe the issue is in the resizing finction itself or I may be missing a step. Thanks.
<!---Check to see what image type was selected to be uploaded--->
<cfif FORM.default EQ "checked">
<cfif CurrentImageName EQ "Thumbnail">
<cfset imageWidth=#FORM.imgWidth#>
</cfif>
</cfif>
<cfif CurrentImageName EQ "Large">
<cfset imageWidth="200">
</cfif>
<cfif CurrentImageName EQ "Expanded">
<cfset imageWidth="400">
</cfif>
<cffile action="upload" filefield="file" destination="#DiskFolderPath#" nameconflict="MakeUnique" accept="image/*">
<!---takes the file being uploaded and saves it into a variable--->
<cfset svrFile = #cffile.serverFile#/>
<!---CF reads the file/image into memory and saves it as myImage--->
<cfset myImage=ImageNew("#DiskFolderPath##svrFile#")/>
<!---CF then resizes the image with the function Imageresize(name, width,height,interpolation,blurfactor(commented out in this sample)--->
<cfset ImageResize(myImage,"#imageWidth#","","lanczos"<!---,5--->)>
<!---CF then writes the new image (myImage) to file destination--->
<cfimage source="#myImage#"
action="write"
destination="#DiskFolderPath##svrFile#"
overwrite="yes">
