Hi Folks,
I have a manual patch for this scenario (FC / imageCFC 1.3.1 modified
on CF8, throwing object instantiation exception) pending an official
fix. It's a bandaid merge of an updated imageCFC version for the
modified simpleImage CFC.
Using '~/farcry_codebase/core/packages/farcry/simpleImage.cfc':
Edit function 'resize' (circa line 220):
Replace this:
resizedImage = CreateObject("java", "java.awt.image.BufferedImage");
at = CreateObject("java", "java.awt.geom.AffineTransform");
op = CreateObject("java", "java.awt.image.AffineTransformOp");
w = myImage.getWidth();
h = myImage.getHeight();
with this:
resizedImage = CreateObject("java", "java.awt.image.BufferedImage");
at = CreateObject("java", "java.awt.geom.AffineTransform");
op = CreateObject("java", "java.awt.image.AffineTransformOp");
if ( myImage.getType() eq 0 ) {
myImage = convertImageObject(myImage,myImage.TYPE_3BYTE_BGR);
}
w = myImage.getWidth();
h = myImage.getHeight();
Then add this function to the component:
<cffunction name="convertImageObject" access="private" output="false"
returnType="any">
<cfargument name="bImage" type="Any" required="yes">
<cfargument name="type" type="numeric" required="yes">
<cfscript>
// convert the image to a specified BufferedImage type and return it
var width = bImage.getWidth();
var height = bImage.getHeight();
var newImage =
createObject("java","java.awt.image.BufferedImage").init(javacast("int",width),
javacast("int",height), javacast("int",type));
// int[] rgbArray = new int[width*height];
var rgbArray = createobject("java",
"java.lang.reflect.Array").newInstance(createobject("java",
"java.lang.Integer").TYPE, javacast("int",width*height));
bImage.getRGB(
javacast("int",0),
javacast("int",0),
javacast("int",width),
javacast("int",height),
rgbArray,
javacast("int",0),
javacast("int",width)
);
newImage.setRGB(
javacast("int",0),
javacast("int",0),
javacast("int",width),
javacast("int",height),
rgbArray,
javacast("int",0),
javacast("int",width)
);
return newImage;
</cfscript>
</cffunction>
That should allow the component to proceed with thumbnail creation.
HTH,
Chris
On 8/19/07, Jeff Coughlin <[EMAIL PROTECTED]> wrote:
>
> > Seems I have a similar issue with CF8 and FarCry 4.
> >
> > When I try to Edit and Save, I get the Object instanciation
> > error as mentionned before.
>
> I am working on a solution for this and should have something up soon for
> people to test within a day.
>
> ---
> Jeff Coughlin
> Web Application Developer
> http://www.jeffcoughlin.com
>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---