Ticket #10173: image.cfc.patch
File image.cfc.patch, 10.1 KB (added by , 12 years ago) |
---|
-
editor/filemanager/connectors/cfm/image.cfc
127 127 <cfif loadImage.errorCode is 0> 128 128 <cfset img = loadImage.img> 129 129 <cfelse> 130 <cfset retVal = throw(loadImage.errorMessage)>130 <cfset retVal = fckthrow(loadImage.errorMessage)> 131 131 <cfreturn retVal> 132 132 </cfif> 133 133 <cfset retVal.metaData = getImageMetadata(loadImage.inFile)> … … 148 148 <cfset retVal.canModify = true> 149 149 <cfreturn retVal> 150 150 <cfcatch type="any"> 151 <cfset retVal = throw( "#cfcatch.message#: #cfcatch.detail#")>151 <cfset retVal = fckthrow( "#cfcatch.message#: #cfcatch.detail#")> 152 152 <cfreturn retVal> 153 153 </cfcatch> 154 154 </cftry> … … 278 278 <cfif loadImage.errorCode is 0> 279 279 <cfset img = loadImage.img> 280 280 <cfelse> 281 <cfset retVal = throw(loadImage.errorMessage)>281 <cfset retVal = fckthrow(loadImage.errorMessage)> 282 282 <cfreturn retVal> 283 283 </cfif> 284 284 <cfelse> … … 321 321 w = newWidth; 322 322 h = newHeight; 323 323 } else { 324 retVal = throw( retVal.errorMessage);324 retVal = fckthrow( retVal.errorMessage); 325 325 return retVal; 326 326 } 327 327 resizedImage.init(javacast("int",w),javacast("int",h),img.getType()); … … 405 405 <cfif loadImage.errorCode is 0> 406 406 <cfset img = loadImage.img> 407 407 <cfelse> 408 <cfset retVal = throw(loadImage.errorMessage)>408 <cfset retVal = fckthrow(loadImage.errorMessage)> 409 409 <cfreturn retVal> 410 410 </cfif> 411 411 <cfelse> … … 420 420 fromY + newHeight gt img.getHeight() 421 421 ) 422 422 { 423 retval = throw( "The cropped image dimensions go beyond the original image dimensions.");423 retval = fckthrow( "The cropped image dimensions go beyond the original image dimensions."); 424 424 return retVal; 425 425 } 426 426 croppedImage = img.getSubimage(javaCast("int", fromX), javaCast("int", fromY), javaCast("int", newWidth), javaCast("int", newHeight) ); … … 470 470 <cfif loadImage.errorCode is 0> 471 471 <cfset img = loadImage.img> 472 472 <cfelse> 473 <cfset retVal = throw(loadImage.errorMessage)>473 <cfset retVal = fckthrow(loadImage.errorMessage)> 474 474 <cfreturn retVal> 475 475 </cfif> 476 476 <cfelse> … … 480 480 <cfset img = convertImageObject(img,img.TYPE_3BYTE_BGR)> 481 481 </cfif> 482 482 <cfif ListFind("-270,-180,-90,90,180,270",degrees) is 0> 483 <cfset retVal = throw( "At this time, image.cfc only supports rotating images in 90 degree increments.")>483 <cfset retVal = fckthrow( "At this time, image.cfc only supports rotating images in 90 degree increments.")> 484 484 <cfreturn retVal> 485 485 </cfif> 486 486 … … 540 540 <cfif loadImage.errorCode is 0> 541 541 <cfset img = loadImage.img> 542 542 <cfelse> 543 <cfset retVal = throw(loadImage.errorMessage)>543 <cfset retVal = fckthrow(loadImage.errorMessage)> 544 544 <cfreturn retVal> 545 545 </cfif> 546 546 <cfelse> … … 550 550 <cfscript> 551 551 if (outputFile eq "") 552 552 { 553 retVal = throw( "The convert method requires a valid output filename.");553 retVal = fckthrow( "The convert method requires a valid output filename."); 554 554 return retVal; 555 555 } else { 556 556 saveImage = writeImage(outputFile, img, jpegCompression); … … 645 645 <cfset retVal.errorMessage = ""> 646 646 647 647 <cfif not fileExists(arguments.inputFile)> 648 <cfset retVal = throw("The specified file #Chr(34)##arguments.inputFile##Chr(34)# could not be found.")>648 <cfset retVal = fckthrow("The specified file #Chr(34)##arguments.inputFile##Chr(34)# could not be found.")> 649 649 <cfreturn retVal> 650 650 <cfelseif listLen(filename,".") lt 2> 651 <cfset retVal = throw("Sorry, image files without extensions cannot be manipulated.")>651 <cfset retVal = fckthrow("Sorry, image files without extensions cannot be manipulated.")> 652 652 <cfreturn retVal> 653 653 <cfelseif listFindNoCase(validExtensionsToRead, extension) is 0> 654 <cfset retVal = throw("Java is unable to read #extension# files.")>654 <cfset retVal = fckthrow("Java is unable to read #extension# files.")> 655 655 <cfreturn retVal> 656 656 <cfelseif NOT fileExists(arguments.inputFile)> 657 <cfset retVal = throw("The specified input file does not exist.")>657 <cfset retVal = fckthrow("The specified input file does not exist.")> 658 658 <cfreturn retVal> 659 659 <cfelse> 660 660 <cfset img = CreateObject("java", "java.awt.image.BufferedImage")> 661 661 <cfset inFile = CreateObject("java", "java.io.File")> 662 662 <cfset inFile.init(arguments.inputFile)> 663 663 <cfif NOT inFile.canRead()> 664 <cfset retVal = throw("Unable to open source file #Chr(34)##arguments.inputFile##Chr(34)#.")>664 <cfset retVal = fckthrow("Unable to open source file #Chr(34)##arguments.inputFile##Chr(34)#.")> 665 665 <cfreturn retVal> 666 666 <cfelse> 667 667 <cftry> 668 668 <cfset img = imageIO.read(inFile)> 669 669 <cfcatch type="any"> 670 <cfset retval = throw("An error occurred attempting to read the specified image. #cfcatch.message# - #cfcatch.detail#")>670 <cfset retval = fckthrow("An error occurred attempting to read the specified image. #cfcatch.message# - #cfcatch.detail#")> 671 671 <cfreturn retVal> 672 672 </cfcatch> 673 673 </cftry> … … 695 695 <cftry> 696 696 <cfset img = imageIO.read(inURL)> 697 697 <cfcatch type="any"> 698 <cfset retval = throw("An error occurred attempting to read the specified image. #cfcatch.message# - #cfcatch.detail#")>698 <cfset retval = fckthrow("An error occurred attempting to read the specified image. #cfcatch.message# - #cfcatch.detail#")> 699 699 <cfreturn retVal> 700 700 </cfcatch> 701 701 </cftry> … … 727 727 <cfset retVal.errorMessage = ""> 728 728 729 729 <cfif listFindNoCase(validExtensionsToWrite, extension) eq 0> 730 <cfset throw("Java is unable to write #extension# files. Valid formats include: #validExtensionsToWrite#")>730 <cfset fckthrow("Java is unable to write #extension# files. Valid formats include: #validExtensionsToWrite#")> 731 731 </cfif> 732 732 733 733 <cfif extension neq "jpg" and extension neq "jpeg"> … … 782 782 <cfif loadImage.errorCode is 0> 783 783 <cfset img = loadImage.img> 784 784 <cfelse> 785 <cfset retVal = throw(loadImage.errorMessage)>785 <cfset retVal = fckthrow(loadImage.errorMessage)> 786 786 <cfreturn retVal> 787 787 </cfif> 788 788 <cfelse> … … 845 845 <cfset retVal.errorMessage = ""> 846 846 847 847 <cfif NOT variables.javanulls> 848 <cfset throw("Sorry, but the blur filter is not supported on this platform.")>848 <cfset fckthrow("Sorry, but the blur filter is not supported on this platform.")> 849 849 </cfif> 850 850 <cfif inputFile neq ""> 851 851 <cfset loadImage = readImage(inputFile, "NO")> 852 852 <cfif loadImage.errorCode is 0> 853 853 <cfset srcImage = loadImage.img> 854 854 <cfelse> 855 <cfset retVal = throw(loadImage.errorMessage)>855 <cfset retVal = fckthrow(loadImage.errorMessage)> 856 856 <cfreturn retVal> 857 857 </cfif> 858 858 <cfelse> … … 912 912 <cfset retVal.errorMessage = ""> 913 913 914 914 <cfif NOT variables.javanulls> 915 <cfset throw("Sorry, but the blur filter is not supported on this platform.")>915 <cfset fckthrow("Sorry, but the blur filter is not supported on this platform.")> 916 916 </cfif> 917 917 918 918 <cfif inputFile neq ""> … … 920 920 <cfif loadImage.errorCode is 0> 921 921 <cfset srcImage = loadImage.img> 922 922 <cfelse> 923 <cfset retVal = throw(loadImage.errorMessage)>923 <cfset retVal = fckthrow(loadImage.errorMessage)> 924 924 <cfreturn retVal> 925 925 </cfif> 926 926 <cfelse> … … 974 974 <cfset retVal.errorMessage = ""> 975 975 976 976 <cfif NOT variables.javanulls> 977 <cfset throw("Sorry, but the blur filter is not supported on this platform.")>977 <cfset fckthrow("Sorry, but the blur filter is not supported on this platform.")> 978 978 </cfif> 979 979 980 980 <cfif inputFile neq ""> … … 982 982 <cfif loadImage.errorCode is 0> 983 983 <cfset srcImage = loadImage.img> 984 984 <cfelse> 985 <cfset retVal = throw(loadImage.errorMessage)>985 <cfset retVal = fckthrow(loadImage.errorMessage)> 986 986 <cfreturn retVal> 987 987 </cfif> 988 988 <cfelse> … … 992 992 <cfset srcImage = convertImageObject(srcImage,srcImage.TYPE_3BYTE_BGR)> 993 993 </cfif> 994 994 <cfif srcImage.getType() neq 5> 995 <cfset throw("ImageCFC cannot posterize this image type (#srcImage.getType()#)")>995 <cfset fckthrow("ImageCFC cannot posterize this image type (#srcImage.getType()#)")> 996 996 </cfif> 997 997 <cfscript> 998 998 // initialize the posterize filter … … 1053 1053 <cfparam name="arguments.fontDetails.fontName" default="serif"> 1054 1054 1055 1055 <cfif arguments.fontDetails.fontFile neq "" and not fileExists(arguments.fontDetails.fontFile)> 1056 <cfset retVal = throw("The specified font file #Chr(34)##arguments.inputFile##Chr(34)# could not be found on the server.")>1056 <cfset retVal = fckthrow("The specified font file #Chr(34)##arguments.inputFile##Chr(34)# could not be found on the server.")> 1057 1057 <cfreturn retVal> 1058 1058 </cfif> 1059 1059 <cftry> 1060 1060 <cfset rgb = getRGB(arguments.fontDetails.color)> 1061 1061 <cfcatch type="any"> 1062 <cfset retVal = throw("Invalid color #Chr(34)##arguments.fontDetails.color##Chr(34)#")>1062 <cfset retVal = fckthrow("Invalid color #Chr(34)##arguments.fontDetails.color##Chr(34)#")> 1063 1063 <cfreturn retVal> 1064 1064 </cfcatch> 1065 1065 </cftry> … … 1068 1068 <cfif loadImage.errorCode is 0> 1069 1069 <cfset img = loadImage.img> 1070 1070 <cfelse> 1071 <cfset retVal = throw(loadImage.errorMessage)>1071 <cfset retVal = fckthrow(loadImage.errorMessage)> 1072 1072 <cfreturn retVal> 1073 1073 </cfif> 1074 1074 <cfelse> … … 1159 1159 <cfif loadImage.errorCode is 0> 1160 1160 <cfset originalImage = loadImage.img> 1161 1161 <cfelse> 1162 <cfset retVal = throw(loadImage.errorMessage)>1162 <cfset retVal = fckthrow(loadImage.errorMessage)> 1163 1163 <cfreturn retVal> 1164 1164 </cfif> 1165 1165 <cfelse> … … 1174 1174 <cfif loadImage.errorCode is 0> 1175 1175 <cfset wmImage = loadImage.img> 1176 1176 <cfelse> 1177 <cfset retVal = throw(loadImage.errorMessage)>1177 <cfset retVal = fckthrow(loadImage.errorMessage)> 1178 1178 <cfreturn retVal> 1179 1179 </cfif> 1180 1180 <cfelse> … … 1266 1266 <cfreturn retVal> 1267 1267 </cffunction> 1268 1268 1269 <cffunction name=" throw" access="private" output="false" returnType="struct">1269 <cffunction name="fckthrow" access="private" output="false" returnType="struct"> 1270 1270 <cfargument name="detail" type="string" required="yes"> 1271 1271 <cfargument name="force" type="boolean" required="no" default="no"> 1272 1272