Ticket #10173: image.cfc.patch

File image.cfc.patch, 10.1 KB (added by Scott Coldwell, 11 years ago)

patch to change function name

  • editor/filemanager/connectors/cfm/image.cfc

     
    127127                <cfif loadImage.errorCode is 0>
    128128                        <cfset img = loadImage.img>
    129129                <cfelse>
    130                         <cfset retVal = throw(loadImage.errorMessage)>
     130                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    131131                        <cfreturn retVal>
    132132                </cfif>
    133133                <cfset retVal.metaData = getImageMetadata(loadImage.inFile)>
     
    148148                <cfset retVal.canModify = true>
    149149                <cfreturn retVal>
    150150                <cfcatch type="any">
    151                         <cfset retVal = throw( "#cfcatch.message#: #cfcatch.detail#")>
     151                        <cfset retVal = fckthrow( "#cfcatch.message#: #cfcatch.detail#")>
    152152                        <cfreturn retVal>
    153153                </cfcatch>
    154154        </cftry>
     
    278278                <cfif loadImage.errorCode is 0>
    279279                        <cfset img = loadImage.img>
    280280                <cfelse>
    281                         <cfset retVal = throw(loadImage.errorMessage)>
     281                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    282282                        <cfreturn retVal>
    283283                </cfif>
    284284        <cfelse>
     
    321321                        w = newWidth;
    322322                        h = newHeight;
    323323                } else {
    324                         retVal = throw( retVal.errorMessage);
     324                        retVal = fckthrow( retVal.errorMessage);
    325325                        return retVal;
    326326                }
    327327                resizedImage.init(javacast("int",w),javacast("int",h),img.getType());
     
    405405                <cfif loadImage.errorCode is 0>
    406406                        <cfset img = loadImage.img>
    407407                <cfelse>
    408                         <cfset retVal = throw(loadImage.errorMessage)>
     408                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    409409                        <cfreturn retVal>
    410410                </cfif>
    411411        <cfelse>
     
    420420                        fromY + newHeight gt img.getHeight()
    421421                        )
    422422                {
    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.");
    424424                        return retVal;
    425425                }
    426426                croppedImage = img.getSubimage(javaCast("int", fromX), javaCast("int", fromY), javaCast("int", newWidth), javaCast("int", newHeight) );
     
    470470                <cfif loadImage.errorCode is 0>
    471471                        <cfset img = loadImage.img>
    472472                <cfelse>
    473                         <cfset retVal = throw(loadImage.errorMessage)>
     473                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    474474                        <cfreturn retVal>
    475475                </cfif>
    476476        <cfelse>
     
    480480                <cfset img = convertImageObject(img,img.TYPE_3BYTE_BGR)>
    481481        </cfif>
    482482        <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.")>
    484484                <cfreturn retVal>
    485485        </cfif>
    486486
     
    540540                <cfif loadImage.errorCode is 0>
    541541                        <cfset img = loadImage.img>
    542542                <cfelse>
    543                         <cfset retVal = throw(loadImage.errorMessage)>
     543                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    544544                        <cfreturn retVal>
    545545                </cfif>
    546546        <cfelse>
     
    550550        <cfscript>
    551551                if (outputFile eq "")
    552552                {
    553                         retVal = throw( "The convert method requires a valid output filename.");
     553                        retVal = fckthrow( "The convert method requires a valid output filename.");
    554554                        return retVal;
    555555                } else {
    556556                        saveImage = writeImage(outputFile, img, jpegCompression);
     
    645645        <cfset retVal.errorMessage = "">
    646646
    647647        <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.")>
    649649                <cfreturn retVal>
    650650        <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.")>
    652652                <cfreturn retVal>
    653653        <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.")>
    655655                <cfreturn retVal>
    656656        <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.")>
    658658                <cfreturn retVal>
    659659        <cfelse>
    660660                <cfset img = CreateObject("java", "java.awt.image.BufferedImage")>
    661661                <cfset inFile = CreateObject("java", "java.io.File")>
    662662                <cfset inFile.init(arguments.inputFile)>
    663663                <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)#.")>
    665665                        <cfreturn retVal>
    666666                <cfelse>
    667667                        <cftry>
    668668                                <cfset img = imageIO.read(inFile)>
    669669                                <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#")>
    671671                                        <cfreturn retVal>
    672672                                </cfcatch>
    673673                        </cftry>
     
    695695        <cftry>
    696696                <cfset img = imageIO.read(inURL)>
    697697                <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#")>
    699699                        <cfreturn retVal>
    700700                </cfcatch>
    701701        </cftry>
     
    727727        <cfset retVal.errorMessage = "">
    728728
    729729        <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#")>
    731731        </cfif>
    732732
    733733        <cfif extension neq "jpg" and extension neq "jpeg">
     
    782782                <cfif loadImage.errorCode is 0>
    783783                        <cfset img = loadImage.img>
    784784                <cfelse>
    785                         <cfset retVal = throw(loadImage.errorMessage)>
     785                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    786786                        <cfreturn retVal>
    787787                </cfif>
    788788        <cfelse>
     
    845845        <cfset retVal.errorMessage = "">
    846846
    847847        <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.")>
    849849        </cfif>
    850850        <cfif inputFile neq "">
    851851                <cfset loadImage = readImage(inputFile, "NO")>
    852852                <cfif loadImage.errorCode is 0>
    853853                        <cfset srcImage = loadImage.img>
    854854                <cfelse>
    855                         <cfset retVal = throw(loadImage.errorMessage)>
     855                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    856856                        <cfreturn retVal>
    857857                </cfif>
    858858        <cfelse>
     
    912912        <cfset retVal.errorMessage = "">
    913913
    914914        <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.")>
    916916        </cfif>
    917917
    918918        <cfif inputFile neq "">
     
    920920                <cfif loadImage.errorCode is 0>
    921921                        <cfset srcImage = loadImage.img>
    922922                <cfelse>
    923                         <cfset retVal = throw(loadImage.errorMessage)>
     923                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    924924                        <cfreturn retVal>
    925925                </cfif>
    926926        <cfelse>
     
    974974        <cfset retVal.errorMessage = "">
    975975
    976976        <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.")>
    978978        </cfif>
    979979
    980980        <cfif inputFile neq "">
     
    982982                <cfif loadImage.errorCode is 0>
    983983                        <cfset srcImage = loadImage.img>
    984984                <cfelse>
    985                         <cfset retVal = throw(loadImage.errorMessage)>
     985                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    986986                        <cfreturn retVal>
    987987                </cfif>
    988988        <cfelse>
     
    992992                <cfset srcImage = convertImageObject(srcImage,srcImage.TYPE_3BYTE_BGR)>
    993993        </cfif>
    994994        <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()#)")>
    996996        </cfif>
    997997        <cfscript>
    998998                // initialize the posterize filter
     
    10531053        <cfparam name="arguments.fontDetails.fontName" default="serif">
    10541054
    10551055        <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.")>
    10571057                <cfreturn retVal>
    10581058        </cfif>
    10591059        <cftry>
    10601060                <cfset rgb = getRGB(arguments.fontDetails.color)>
    10611061                <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)#")>
    10631063                        <cfreturn retVal>
    10641064                </cfcatch>
    10651065        </cftry>
     
    10681068                <cfif loadImage.errorCode is 0>
    10691069                        <cfset img = loadImage.img>
    10701070                <cfelse>
    1071                         <cfset retVal = throw(loadImage.errorMessage)>
     1071                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    10721072                        <cfreturn retVal>
    10731073                </cfif>
    10741074        <cfelse>
     
    11591159                <cfif loadImage.errorCode is 0>
    11601160                        <cfset originalImage = loadImage.img>
    11611161                <cfelse>
    1162                         <cfset retVal = throw(loadImage.errorMessage)>
     1162                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    11631163                        <cfreturn retVal>
    11641164                </cfif>
    11651165        <cfelse>
     
    11741174                <cfif loadImage.errorCode is 0>
    11751175                        <cfset wmImage = loadImage.img>
    11761176                <cfelse>
    1177                         <cfset retVal = throw(loadImage.errorMessage)>
     1177                        <cfset retVal = fckthrow(loadImage.errorMessage)>
    11781178                        <cfreturn retVal>
    11791179                </cfif>
    11801180        <cfelse>
     
    12661266        <cfreturn retVal>
    12671267</cffunction>
    12681268
    1269 <cffunction name="throw" access="private" output="false" returnType="struct">
     1269<cffunction name="fckthrow" access="private" output="false" returnType="struct">
    12701270        <cfargument name="detail" type="string" required="yes">
    12711271        <cfargument name="force" type="boolean" required="no" default="no">
    12721272
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy