House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

ColdFusion 8 Image resize help

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
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
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Sanders
09/17/2007 12:20 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jayesh Viradiya
09/17/2007 03:51 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jayesh Viradiya
09/17/2007 05:54 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Sanders
09/17/2007 07:10 PM

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


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference