Starting from a fresh install of v4, I had problems with uploading an
image to a page when wanting Farcry to create the thumbnail
automatically.

I found the solution somewhere on the www (cant remember the URL
unfortunately), which required changing the simpleImage.cfc file
around line 212 or so:-

        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();


and adding a new function:-

<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>


HTH


On Sep 11, 1:15 pm, modius <[EMAIL PROTECTED]> wrote:
> On Sep 10, 7:28 pm, BazD <[EMAIL PROTECTED]> wrote:
>
> > Many thanks for your replies.
>
> > Other than having to alter image.cfc code when uploading images, my
> > farcry install appears to be working fine.
>
> Is there any specific issue with image.cfc that we should be aware
> of?  Please raise an issue and attach your fix if you think it might
> be relevant to the rest of the community.
>
> Many thanks,
>
> -- geoffhttp://www.daemon.com.au/


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to