|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
ColdFusion 8 Image resize help
Hey list,Rick Sanders 09/17/07 12:20 P Hi Rick,Jayesh Viradiya 09/17/07 03:51 P Hi Rick,Jayesh Viradiya 09/17/07 05:54 P Hello Jayesh,Rick Sanders 09/17/07 07:10 P Hey list, I'm having a problem using the image resize with a variable with CF 8. The error I'm getting is: Unable to cast an object of type java.lang.String to Image. The error occurred in E:\Websites\ironwillsports\submitvideo3.cfm: line 19 17 : <cfset oldthumb = "#cffile.ClientFileName#.#cffile.ClientFileExt#"> 18 : <cfset thumb=ImageNew("E:\websites\ironwillsports\thumbs\#oldthumb#")> 19 : <cfset ImageResize("#oldthumb#","","75","mitchell",1)> 20 : <cfimage source="#oldthumb#" action="write" destination="E:\websites\ironwillsports\thumbs\#cffile.ClientFileName#.#cffi le.ClientFileExt#" overwrite="yes"> 21 : </cfif> My code is: <cfset oldthumb = "#cffile.ClientFileName#.#cffile.ClientFileExt#"> <cfset thumb=ImageNew("E:\websites\ironwillsports\thumbs\#oldthumb#")> <cfset ImageResize("#oldthumb#","","75","mitchell",1)> <cfimage source="#oldthumb#" action="write" destination="E:\websites\ironwillsports\thumbs\#cffile.ClientFileName#.#cffi le.ClientFileExt#" overwrite="yes"> Any help would be greatly appreciated. Thanks! Webenergy Rick Sanders President Canada: 902-401-7689 USA: 919-799-9076 Canada: www.webenergy.ca USA: www.webenergyusa.com Hi Rick, Your code should be as below as below and it should work. Inside ImageResize() function, you should pass the image Object created through ImageNew() function...that is, "thumb" and not "oldthumb". "oldthumb" is a filename/path which is not accepted by ImageResize function. <cfset oldthumb = "#cffile.ClientFileName#.#cffile.ClientFileExt#"> <cfset thumb=ImageNew("E:\websites\ironwillsports\thumbs\#oldthumb#")> <cfset ImageResize("#thumb#","","75","mitchell",1)> <cfimage source="#oldthumb#" action="write" destination="E:\websites\ironwillsports\thumbs\#cffile.ClientFileName#.# cffi le.ClientFileExt#" overwrite="yes"> Thanks Jayesh Viradiya Adobe CF Team Hey list, I'm having a problem using the image resize with a variable with CF 8. The error I'm getting is: Unable to cast an object of type java.lang.String to Image. The error occurred in E:\Websites\ironwillsports\submitvideo3.cfm: line 19 17 : <cfset oldthumb = "#cffile.ClientFileName#.#cffile.ClientFileExt#"> 18 : <cfset thumb=ImageNew("E:\websites\ironwillsports\thumbs\#oldthumb#")> 19 : <cfset ImageResize("#oldthumb#","","75","mitchell",1)> 20 : <cfimage source="#oldthumb#" action="write" destination="E:\websites\ironwillsports\thumbs\#cffile.ClientFileName#.# cffi le.ClientFileExt#" overwrite="yes"> 21 : </cfif> My code is: <cfset oldthumb = "#cffile.ClientFileName#.#cffile.ClientFileExt#"> <cfset thumb=ImageNew("E:\websites\ironwillsports\thumbs\#oldthumb#")> <cfset ImageResize("#oldthumb#","","75","mitchell",1)> <cfimage source="#oldthumb#" action="write" destination="E:\websites\ironwillsports\thumbs\#cffile.ClientFileName#.# cffi le.ClientFileExt#" overwrite="yes"> Any help would be greatly appreciated. Thanks! Webenergy Rick Sanders President Canada: 902-401-7689 USA: 919-799-9076 Canada: www.webenergy.ca USA: www.webenergyusa.com Hi Rick, Your code should be as below as below and it should work. Inside ImageResize() function, you should pass the image Object created through ImageNew() function...that is, "thumb" and not "oldthumb". "oldthumb" is a filename/path which is not accepted by ImageResize function. <cfset oldthumb = "#cffile.ClientFileName#.#cffile.ClientFileExt#"> <cfset thumb=ImageNew("E:\websites\ironwillsports\thumbs\#oldthumb#")> <cfset ImageResize("#thumb#","","75","mitchell",1)> <cfimage source="#oldthumb#" action="write" destination="E:\websites\ironwillsports\thumbs\#cffile.ClientFileName#.# cffi le.ClientFileExt#" overwrite="yes"> Thanks & Regards Jayesh Viradiya Adobe CF Team Hello Jayesh, Thank you for your quick response! I'll try it out, and continue on with this program! Kind regards, Rick Sanders President Canada: 902-401-7689 USA: 919-799-9076 Canada: www.webenergy.ca USA: www.webenergyusa.com Hi Rick, Your code should be as below as below and it should work. Inside ImageResize() function, you should pass the image Object created through ImageNew() function...that is, "thumb" and not "oldthumb". "oldthumb" is a filename/path which is not accepted by ImageResize function. <cfset oldthumb = "#cffile.ClientFileName#.#cffile.ClientFileExt#"> <cfset thumb=ImageNew("E:\websites\ironwillsports\thumbs\#oldthumb#")> <cfset ImageResize("#thumb#","","75","mitchell",1)> <cfimage source="#oldthumb#" action="write" destination="E:\websites\ironwillsports\thumbs\#cffile.ClientFileName#.# cffi le.ClientFileExt#" overwrite="yes"> Thanks & Regards Jayesh Viradiya Adobe CF Team
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||