ImageCFC 2.00b3 Now Available
Categories: Image Manipulation
I've just released version 2.00 beta 3 of my Image Manipulation CFC. It includes some bug fixes, and addition error trapping.
| Project: | ImageCFC |
| Home page: | http://www.opensourcecf.com/imagecfc |
| Author: | Rick Root |
| License: | BSD |
| Platform: | CFMX 6.1+, Bluedragon 6.2+ |
| Description: | Description: ImageCFC is an image manipulation component which allows you to resize, rotate, flip, and crop images. It also allows you to add text using TrueType fonts to your images, and control JPEG compression quality. It can read gif, jpg, and png images, either from the local file system or via a URL. It can write JPG and PNG images. GIF images can be manipulated but they cannot be saved as GIF images, they must be saved as PNG images. |
Posted by rickroot at 8:12 AM | Link | 13 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.00b3 Now Available
This CFC looks very promising, but the rhe link to download imageCFC isn't working: http://www.opensourcecf.com/download.cfm?p=1
In IE it's giving the old Page cannot be displayed. In firefox, it's redirecting me to http://cfopen.org/frs/?group_id=87, which then cannot be displayed.
In IE it's giving the old Page cannot be displayed. In firefox, it's redirecting me to http://cfopen.org/frs/?group_id=87, which then cannot be displayed.
Posted by coos on February 23, 2006 at 7:41 PM
Re: ImageCFC 2.00b3 Now Available
worked fine for me. Maybe cfopen was down when you tried.
Posted by rickroot on February 24, 2006 at 10:21 AM
Re: ImageCFC 2.00b3 Now Available
I'm an amateur needing some help. Need some documentation reading an image's dimensions using ImageCFC. Can someone tell me where there's any other examples besides the examples on this site?
Thanks.
Thanks.
Posted by defarm on May 6, 2006 at 6:13 AM
Re: ImageCFC 2.00b3 Now Available
OK... how do we pass the getImageInfo objImage argument in. Could you give us an example of that?
Posted by sosensible on June 8, 2006 at 1:22 PM
Re: ImageCFC 2.00b3 Now Available
you would typically only do that if you had the imageCFC return on image object rather than write out a file. It would return the image object and then you could pass it back to the image CFC for further manipulation - essentially allowing you to do multiple modifications (resize, crop, whatever) before saving it back out to disk.
Posted by rickroot on June 8, 2006 at 6:31 PM
Re: ImageCFC 2.00b3 Now Available
Works great if I comment out the "required attribute". I was thinking of adding a function and passing it back if you think others would be interested. I was thinking about having something that created a maximum size by passing in maximun height and width. Then scale proportionally to which size was most intrusive. (It could be used to return either the dimentions or in turn used to size and store an actuall image.) What do you think?
Posted by sosensible on June 8, 2006 at 9:02 PM
Re: ImageCFC 2.00b3 Now Available
And in your example... do you have to copy a font to the directory to make that work as written on your example code page?
Posted by sosensible on June 8, 2006 at 9:03 PM
Re: ImageCFC 2.00b3 Now Available
it works great anyway, just pass in an empty string as the image object if you're not using it.
As for the font, it can be located anywhere on the system as long as you specify the full path... ie:
or something like that.
As for the font, it can be located anywhere on the system as long as you specify the full path... ie:
or something like that.
Posted by rickroot on June 9, 2006 at 5:36 AM
Re: ImageCFC 2.00b3 Now Available
The code below is giving me the following error:
Element IMG is undefined in STRIMAGE.
Can anyone please tell me what I am doing wrong?
You did not select an image, please #CGI.HTTP_REFERER#">go back to select an image.
Scaled to
640 width and text added:
#cffile.serverfile#" />
Width: #strImageInfo.width# pixels
Height: #strImageInfo.height# pixels
Element IMG is undefined in STRIMAGE.
Can anyone please tell me what I am doing wrong?
You did not select an image, please #CGI.HTTP_REFERER#">go back to select an image.
Scaled to
640 width and text added:
#cffile.serverfile#" />
Width: #strImageInfo.width# pixels
Height: #strImageInfo.height# pixels
Posted by 7079 on July 24, 2006 at 6:23 AM
Re: ImageCFC 2.00b3 Now Available
I didn't notice the no HTML allowed! message below, let me know where I can send the code so you can view it and tell me what I am doing wrong.
Awesome CFC by the way, in the process of switching from custom image tag to this CFC.
Thanks,
Awesome CFC by the way, in the process of switching from custom image tag to this CFC.
Thanks,
Posted by 7079 on July 24, 2006 at 6:25 AM
Re: ImageCFC 2.00b3 Now Available
I realized what the mistake was when trying multiple operations on the same image and loading the image obj rather than defining an input file. The issue I am facing is that when using the scaleX function first and passing the img object to the addtext function, the image is not written to file. I also noticed that this issue is documented on the following site by the author of the blog: http://www.remotesynthesis.com/blog/index.cfm/2006/4/3/Image-Manipulation-with-OpenSource-Imagecfc
When using the individual functions and specifying an input file, the functions work fine. I am interested in the ability of scaling down the image and adding text as you did in your example. If you can offer assistance or post something here that will help resolve the issue, we would greatly appreciate it. I am trying to update previous apps that I worked on from custom tags to your cfc which seems to produce better quality results.
Thanks in advance!
When using the individual functions and specifying an input file, the functions work fine. I am interested in the ability of scaling down the image and adding text as you did in your example. If you can offer assistance or post something here that will help resolve the issue, we would greatly appreciate it. I am trying to update previous apps that I worked on from custom tags to your cfc which seems to produce better quality results.
Thanks in advance!
Posted by 7079 on July 25, 2006 at 8:39 AM
Re: ImageCFC 2.00b3 Now Available
I was able to resolve the issue I was having, you can follow up on it at the following link: http://www.easycfm.com/forums/viewmessages.cfm?Forum=12&Topic=9698
I built on an example from the following blog: http://www.remotesynthesis.com/blog/index.cfm/2006/4/3/Image-Manipulation-with-OpenSource-Imagecfc
The example I provided has a form and a form handler that can be modified to work in any application, all you have to do is customize it to suit your needs.
Hope the information that I posted is helpful for those who are having trouble!
H Jaber
I built on an example from the following blog: http://www.remotesynthesis.com/blog/index.cfm/2006/4/3/Image-Manipulation-with-OpenSource-Imagecfc
The example I provided has a form and a form handler that can be modified to work in any application, all you have to do is customize it to suit your needs.
Hope the information that I posted is helpful for those who are having trouble!
H Jaber
Posted by 7079 on July 26, 2006 at 7:15 AM
Re: ImageCFC 2.00b3 Now Available
This doesn't work on Railo (railo.ch): heres the error
Railo [1.0.0.026] - Error (java.lang.ClassCastException)
Message java.lang.ClassCastException
Context The Error Occurred in
C:\Program Files\Railo\webapps\ROOT\cfcs\image.cfc: line 442
called from C:\Program Files\Railo\webapps\ROOT\cfcs\image.cfc: line 183
called from C:\Program Files\Railo\webapps\ROOT\cfcs\image.cfc: line 153
called from C:\Program Files\Railo\webapps\ROOT\imagetest.cfm: line 3
Code 440:
441:
442:
443:
444:
Java Stacktrace
java.lang.ClassCastException
at java.awt.RenderingHints.get(Unknown Source):-1
at railo.runtime.util.VariableUtilImpl.get(Unknown Source):-1
at railo.runtime.java.JavaObject.get(Unknown Source):-1
at railo.runtime.util.VariableUtilImpl.get(Unknown Source):-1
at railo.runtime.PageContextImpl.get(Unknown Source):-1
at cfcs.image_cfc276$1$11.implementation(image_cfc276.java:1048):1048
at railo.runtime.type.UserDefinedFunctionImpl.a(Unknown Source):-1
at railo.runtime.type.UserDefinedFunctionImpl.call(Unknown Source):-1
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(Unknown Source):-1
at railo.runtime.PageContextImpl.getFunction(Unknown Source):-1
at cfcs.image_cfc276$1$7.implementation(image_cfc276.java:375):375
at railo.runtime.type.UserDefinedFunctionImpl.a(Unknown Source):-1
at railo.runtime.type.UserDefinedFunctionImpl.call(Unknown Source):-1
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(Unknown Source):-1
at railo.runtime.PageContextImpl.getFunction(Unknown Source):-1
at cfcs.image_cfc276$1$5.implementation(image_cfc276.java:276):276
at railo.runtime.type.UserDefinedFunctionImpl.a(Unknown Source):-1
at railo.runtime.type.UserDefinedFunctionImpl.call(Unknown Source):-1
at railo.runtime.ComponentImpl.a(Unknown Source):-1
at railo.runtime.ComponentImpl.a(Unknown Source):-1
at railo.runtime.ComponentImpl.call(Unknown Source):-1
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(Unknown Source):-1
at railo.runtime.PageContextImpl.getFunction(Unknown Source):-1
at imagetest_cfm.call(imagetest_cfm.java:33):33
at railo.runtime.PageContextImpl.include(Unknown Source):-1
at railo.runtime.PageContextImpl.execute(Unknown Source):-1
at railo.runtime.engine.CFMLEngineImpl.serviceCFML(Unknown Source):-1
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
at javax.servlet.http.HttpServlet.service(HttpServlet.java:92):92
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:99):99
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:163):163
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208):208
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:259):259
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:363):363
at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490):490
at com.caucho.util.ThreadPool.run(ThreadPool.java:423):423
at java.lang.Thread.run(Unknown Source):-1
Debugging Output
Pages
file count load query app total
Total 6 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\WEB-INF\railo\context\templates\debugging\debugging.cfm 1 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\Application.cfm 1 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\imagetest.cfm 1 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\cfcs\image.cfc 1 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\cfcs\image.cfc$scaleX 1 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\WEB-INF\railo\context\Component.cfc 1 0 0 0 0
Total 6 0 0 0 0
file count load query app total
Queries
Railo [1.0.0.026] - Error (java.lang.ClassCastException)
Message java.lang.ClassCastException
Context The Error Occurred in
C:\Program Files\Railo\webapps\ROOT\cfcs\image.cfc: line 442
called from C:\Program Files\Railo\webapps\ROOT\cfcs\image.cfc: line 183
called from C:\Program Files\Railo\webapps\ROOT\cfcs\image.cfc: line 153
called from C:\Program Files\Railo\webapps\ROOT\imagetest.cfm: line 3
Code 440:
441:
442:
443:
444:
Java Stacktrace
java.lang.ClassCastException
at java.awt.RenderingHints.get(Unknown Source):-1
at railo.runtime.util.VariableUtilImpl.get(Unknown Source):-1
at railo.runtime.java.JavaObject.get(Unknown Source):-1
at railo.runtime.util.VariableUtilImpl.get(Unknown Source):-1
at railo.runtime.PageContextImpl.get(Unknown Source):-1
at cfcs.image_cfc276$1$11.implementation(image_cfc276.java:1048):1048
at railo.runtime.type.UserDefinedFunctionImpl.a(Unknown Source):-1
at railo.runtime.type.UserDefinedFunctionImpl.call(Unknown Source):-1
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(Unknown Source):-1
at railo.runtime.PageContextImpl.getFunction(Unknown Source):-1
at cfcs.image_cfc276$1$7.implementation(image_cfc276.java:375):375
at railo.runtime.type.UserDefinedFunctionImpl.a(Unknown Source):-1
at railo.runtime.type.UserDefinedFunctionImpl.call(Unknown Source):-1
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(Unknown Source):-1
at railo.runtime.PageContextImpl.getFunction(Unknown Source):-1
at cfcs.image_cfc276$1$5.implementation(image_cfc276.java:276):276
at railo.runtime.type.UserDefinedFunctionImpl.a(Unknown Source):-1
at railo.runtime.type.UserDefinedFunctionImpl.call(Unknown Source):-1
at railo.runtime.ComponentImpl.a(Unknown Source):-1
at railo.runtime.ComponentImpl.a(Unknown Source):-1
at railo.runtime.ComponentImpl.call(Unknown Source):-1
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(Unknown Source):-1
at railo.runtime.PageContextImpl.getFunction(Unknown Source):-1
at imagetest_cfm.call(imagetest_cfm.java:33):33
at railo.runtime.PageContextImpl.include(Unknown Source):-1
at railo.runtime.PageContextImpl.execute(Unknown Source):-1
at railo.runtime.engine.CFMLEngineImpl.serviceCFML(Unknown Source):-1
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
at javax.servlet.http.HttpServlet.service(HttpServlet.java:92):92
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:99):99
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:163):163
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208):208
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:259):259
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:363):363
at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490):490
at com.caucho.util.ThreadPool.run(ThreadPool.java:423):423
at java.lang.Thread.run(Unknown Source):-1
Debugging Output
Pages
file count load query app total
Total 6 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\WEB-INF\railo\context\templates\debugging\debugging.cfm 1 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\Application.cfm 1 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\imagetest.cfm 1 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\cfcs\image.cfc 1 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\cfcs\image.cfc$scaleX 1 0 0 0 0
C:\Program Files\Railo\webapps\ROOT\WEB-INF\railo\context\Component.cfc 1 0 0 0 0
Total 6 0 0 0 0
file count load query app total
Queries
Posted by jeffg on August 6, 2006 at 9:48 AM
Post a comment (login required)