My Projects
Search Blog

Categories
Archives
Useful Links
Photo Albums
RSS

Powered by
BlogCFM v1.15

Vivio Technologies Dedicated Hosting
13 December 2006
ImageCFC 2.10 Released
More features for coldfusion image processing

Project Page for ImageCFC:  http://www.opensourcecf.com/imagecfc/

version 2.10 adds image filtering capability to ImageCFC, including the following:

 o simple blur (very fast)
 o box blur (slow)
 o gaussian blur (slow)
 o sharpen
 o posterize

Some examples of each of the filters.

http://www.opensourcecf.com/imagecfc/examples.cfm

Thanks to everyone who assisted via the list!

Rick

Posted by rickroot at 4:10 PM | Link | 8 comments
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

Re: ImageCFC 2.10 Released
Hi Rick,

Couldn't find a contact address anywhere, so I hope you don't mind me posting these issues here...

I'm having two separate problems when resizing images using imageCFC 2.1.0.
* If I create a new image object using the readImage() method and then pass this image object to the resize() method, I get an error "The selected method getWidth was not found" on line 204.
* If I use the resize() method and pass in both the source and destination file paths CF throws an error when moving the temp file. The tmp file is created, is owned by the same user as the CF user and is readable. CFFILE says the source attribute is invalid.

I have worked around the problems by hacking the code to avoid creating a temporary file and passing in both the source and destination file paths. Maybe the use of a temporary file should be optional?

I'm running CFMX6.1 on RHEL3 (well, centOS) with J2SE 1.4.2_12 in headless mode and with the Pure Java AWT.


Mark
Posted by mwoods on December 14, 2006 at 1:49 PM

Re: ImageCFC 2.10 Released
Doh, just found your email address in the readme - it's been a long day!
Posted by mwoods on December 14, 2006 at 1:51 PM

Re: ImageCFC 2.10 Released
Let's keep the discussion here anyway =)

Can I see the original code you used for the first issue?

The second issue almost sounds like it's related to advanced (sandbox) security or something, because I can't imagine why CFFILE would say the source attribute was invalid if java was able to CREATE the file in the first place.

The temporary file is used to avoid an issue with resizing where resizing an image down worked but didn't change the file size. I suppose it would only be necessary if the source and destination files were the same.

BTW download 2.11 before you get too much further. The syntax hasn't changed but there's a bugfix in the getOption() method and the gaussiand an box blurs are "somewhat" faster.
Posted by rickroot on December 14, 2006 at 1:56 PM

Re: ImageCFC 2.10 Released
This is the code...


filePath = "/blab/blah/tmp/myfile.jpg";
thumbnailPath = "/blab/blah/tmp/myfile_thumb.jpg";
imageCfc = createObject("component","image");
imageCfc.setOption("throwonerror",true);
imageCfc.setOption("defaultJpegCompression",80);
imageObj = imageCfc.readImage(filePath,true);
imageCfc.resize(imageObj,"",thumbnailPath,150,0);
//imageCfc.resize("",filePath,thumbnailPath,150,0);


BTW, we don't have advanced security enabled. I can't really explain it either tbh, though my brain is fried at this stage (it's 10:30pm here, things may make more sense in the morning).

Cheers

Mark
Posted by mwoods on December 14, 2006 at 5:27 PM

Re: ImageCFC 2.10 Released
Ok, this seems to be some CF oddity, move fails, but copy then delete works fine.
Posted by mwoods on December 14, 2006 at 5:47 PM

Re: ImageCFC 2.10 Released
Mark,

One problem with that code is your use of readImage() is not correct. readImage() returns a structure, not an image object. The elements of the structure are errorCode, errorMessage, and img.

So the correct syntax for resize would be:

imageObj = imageCfc.readImage(filePath,true);
imageCfc.resize(imageObj.img,"",thumbnailPath,150,0);
Posted by rickroot on December 15, 2006 at 9:59 AM

Re: ImageCFC 2.10 Released
I can't duplicate the OTHER error... regarding the invalid source attribute with the cffile action="move" ...
Posted by rickroot on December 15, 2006 at 10:00 AM

Re: ImageCFC 2.10 Released
Thanks for the response, and apologies for the wild goose chase re the first issue. Regarding the second issue, I've since updated my copy of image.cfc to try and move the temp file and if fails, copy then delete. This is working fine.

Thanks for your help, and for the code - nice work!
Posted by mwoods on December 15, 2006 at 10:13 AM

Post a comment (login required)