Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

image.cfc and cf8 -- issues???

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
US
Has any used image.cfc on HostMySite?

This was working just fine until I went back on working on the site thsi weekend. When I use my upload form and attach three jpg images to be resized and watermarked, I now get an error that says:

An exception occurred when instantiating a Java object. The class must not be an interface or an abstract class. Error: ''.

Any ideas why? I am using v2.14


_____________________________
Just Imagine.
 
I did some more research on Google, and came across this link: image.cfc thread. I made those changes and now I am getting a different error.

Now, I get: The NEWWIDTH argument passed to the resize function is not of type numeric. I triple checked the code and know I am passing a numeric value for the NewWidth argument.

The stack trace says:
Code:
coldfusion.runtime.UDFMethod$InvalidArgumentTypeException: The NEWWIDTH argument passed to the resize function is not of type numeric. at coldfusion.runtime.UDFMethod._validateArg(UDFMethod.java:789) at coldfusion.runtime.UDFMethod._validateArg(UDFMethod.java:802) at cfImageObject2ecfc1277146545$funcRESIZE.runFunction(C:\Websites\xw7s1b3k\admin\ImageObject.cfc:150) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2260) at cfaddinglisting_act2ecfm1332071854._factor18(C:\Websites\xw7s1b3k\admin\addinglisting_act.cfm:269) at cfaddinglisting_act2ecfm1332071854._factor21(C:\Websites\xw7s1b3k\admin\addinglisting_act.cfm:262) at cfaddinglisting_act2ecfm1332071854._factor22(C:\Websites\xw7s1b3k\admin\addinglisting_act.cfm:96) at cfaddinglisting_act2ecfm1332071854._factor25(C:\Websites\xw7s1b3k\admin\addinglisting_act.cfm:95) at cfaddinglisting_act2ecfm1332071854.runPage(C:\Websites\xw7s1b3k\admin\addinglisting_act.cfm:1) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126) at coldfusion.CfmServlet.service(CfmServlet.java:175) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

_____________________________
Just Imagine.
 
The order of the arguments that you pass into that function matters. So, make sure your order is as same as the order expected in that function. Hoping that you declare NEWWIDTH of type numeric...

 
I'll post how I use the tag later tonight. But as I checked it one var at a time, I am almost 100% sure I am calling them in the right order. Not sure if something else might be causing the error too...

_____________________________
Just Imagine.
 
I notified HMS so if other users have this problem they don't have to abandon image.cfc

For a second I considered using the <cfimage> tag so I can do resize and watermark functionality. But for some reason <cfimage> didn't appeal to me.

has a nice tut on this, but from the article I get the impression the watermark image is "painted" on the original image as the image loads in the browser.

image.cfc allows me to create a new watermarked image and save that on the server. This way if someone downloads the image the company logo is seen on it (or the copyright info).

As a web developer you want to make the site w3c compatible. From what I've seen/read, cfimage doesn't allow usage of the "alt" attribute when writing to the browser:

_____________________________
Just Imagine.
 
Strange that cfimage omitted the alt attribute. Though there is a work-around in the link you posted. I also saw a post that mentioned this was submitted as an enhancement request.

image.cfc allows me to create a new watermarked image and save that on the server

This should be possible using the Image functions.

but from the article I get the impression the watermark image is
"painted" on the original image
Yes, I could be wrong but that is my understanding as well.

You can use java image classes to paint the watermark on the alpha channel. Though I suspect that is what image.cfc is doing already.

----------------------------------
 
I also get the feeling that cfimage resizes upon every load, while image.cfc resizes the image and allows me to save that resized image on the server.

_____________________________
Just Imagine.
 
I am curious what do you mean by resizes on every load? Cfimage should work the same way. ie You can do an explicit resize and save the resized image on the server.

----------------------------------
 
Well, the link I posted above has a part2 article ( and from there the examples first has a action="resize", then another call that does action="writetobrowser". I haven't seen an example that resizes the image, and allows you to save it on the server (under a new name, if needed).

_____________________________
Just Imagine.
 
There may be one in the documenation. Though there are a lot of examples to wade through.

Anway, here is quick example. Change the paths as needed.

Code:
<cfimage action="resize"
	source="#ExpandPath('example.png')#"
	destination="#ExpandPath('exampleSmaller.png')#"
	width="50"
	height="50"
	overwrite="true">

----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top