• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ImageCrop suddenly stopped working

Contributor ,
Oct 02, 2015 Oct 02, 2015

Copy link to clipboard

Copied

I have a cfm file that has been working for years on a remote shared server, which saves an uploaded image, crops it, resizes it and then saves it to a different folder as a thumbnail.

The upload save, get image metadata, resize, and save of resized file all work fine, but if I include the imageCrop line, then it fails silently at that point with no error.

It looks as though the imageCrop function is failing to load the image to manipulate it. But since everything else works, I can't think how this could be.

Anyone got any clues where I can look.

Doug

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2015 Oct 02, 2015

Copy link to clipboard

Copied

Could you show us how you include the imageCrop line?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 02, 2015 Oct 02, 2015

Copy link to clipboard

Copied

This is a test version of the file. If I comment out the cfif surrounding the imageCrop it all works. If it's in it fails with no error.

<cftry>

    <cfimage source="D:\inetpub\abcd\images\2DD425CD-9AED-4182-BBA6-DD6792FCA70BAmbassador.jpg" name="img">

    <cfset w = imageGetWidth(img)>

    <cfset h = imageGetHeight(img)>

    <cfif w/h LT 1>

        <cfset r = round((h-w)/2)>

        <cfset imageCrop(img, 0, r, w, w)>

    <cfelse>

        <cfset r = round((w-h)/2)>

        <cfset imageCrop(img, r, 0, h, h)>

    </cfif>

    <cfset imageResize(img, 54, 54)>

    <cfimage source="#img#" action="write" destination="D:\inetpub\abcd\images\thumbnails\2DD425CD-9AED-4182-BBA6-DD6792FCA70BAmbassador.jpg" overwrite="yes" quality="1">

    <cfcatch>

        <cfdump var="#cfcatch#" output="D:\inetpub\abcd\dumpfil.html" format="html">

    </cfcatch>

</cftry>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2015 Oct 02, 2015

Copy link to clipboard

Copied

doug777 wrote:

<cfif w/h LT 1>

        <cfset r = round((h-w)/2)>

        <cfset imageCrop(img, 0, r, w, w)>

    <cfelse>

        <cfset r = round((w-h)/2)>

        <cfset imageCrop(img, r, 0, h, h)>

    </cfif>

Case w/h < 1:

        The way you define r, it will be less than w only if h < 3*w. Otherwise the y-origin of the crop area will lie outside the image.

Case w/h >= 1:

        The way you define r, it will be less than h only if w < 3*h. Otherwise the x-origin of the crop area will lie outside the image.

In either case, you want the origin of the crop coordinates to lie within the picture. The correct condtions to achieve this are, respectively:

<cfif w/h LT 1 and h LTE 3*w>

<cfelseif w/h GTE 1 and w LTE 3*h>

You can see from this that:

1) when w/h < 1, the crop formula, r = round((h-w)/2), is valid only if 1/3 < w/h < 1;

1) when w/h > 1, the crop formula, r = round((w-h)/2), is valid only if 1/3 < h/w < 1;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 03, 2015 Oct 03, 2015

Copy link to clipboard

Copied

Thanks for your reply, but I can't agree with your maths.

If w/h < 1, then h must be greater than w.

Then h-w must be less than h and (h-w)/2 is less than that. So r must be less than h.

Since r sets the y position, y must lie within the height of the image.

The same applies to the x position when w/h is 1 or greater than 1 except that in this case r and therefore x can be 0.

The purpose of this is to cut the largest possible square from the center of the image.

But anyway, this original function has been working for years without problem and has uploaded and created thumbnails for thousands of images.

It has not failed until last week, when it and several similar functions all suddenly stopped working.

I have found one other clue since original posting. If I use an image that has spaces in the file name, with imageCrop commented out the other parts work, but when imageCrop is included, I get a server error 500.

Doug

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2015 Oct 04, 2015

Copy link to clipboard

Copied

doug777 wrote:

Thanks for your reply, but I can't agree with your maths.

If w/h < 1, then h must be greater than w.

Then h-w must be less than h and (h-w)/2 is less than that. So r must be less than h.

Since r sets the y position, y must lie within the height of the image.

The same applies to the x position when w/h is 1 or greater than 1 except that in this case r and therefore x can be 0.

The purpose of this is to cut the largest possible square from the center of the image.

Your code certainly achieves the purpose of  cutting the largest possible square from the middle of the image. I was looking for a possible explanation for the breakdown. I once had a rare bug where the crop seemed to be only possible if it could fit within the crop area.

In any case, you should have got an error rather than a server crash. So, let's look further.


But anyway, this original function has been working for years without problem and has uploaded and created thumbnails for thousands of images.

It has not failed until last week, when it and several similar functions all suddenly stopped working.

I have found one other clue since original posting. If I use an image that has spaces in the file name, with imageCrop commented out the other parts work, but when imageCrop is included, I get a server error 500.

Strong point. What are the other functions?

Are there any clues in the log files?

Could you show us the code that defines the variables img, w and h. What happens when you test with an image whose w and h you know, say, w=150, h=200, with the code,

<cfset imageCrop(img, 0, 25, 150, 150)>

Talking about bugs, you should look into  you look into Jamo's suggestion.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 04, 2015 Oct 04, 2015

Copy link to clipboard

Copied

cfdump img vars.png

This is the image I'm testing with. It is one that was previously uploaded and has a thumbnail created by this program. If it worked, the thumbnail should be overwritten, but when imageCrop is in the code, it does not get overwritten. I'm trying to set up another test to show the error more clearly. Will post what results I get from that tomorrow.

Many thanks for your help.

Doug

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2015 Oct 04, 2015

Copy link to clipboard

Copied

I have taken a good look at your code. Everything seems to be in the right place. It should work.

Something else seems to be the problem. You mentioned that other image functions fail. Which ones? Did you define the variables, name, width and height for these functions exactly as you did for img, w and h in your above code?

A server error is severe, suggesting a problem that is unrelated to the image functions. I thought of a new idea to rule out: a threading bug. Does the following test work?

<cftry>

    <cfimage source="D:\inetpub\abcd\images\2DD425CD-9AED-4182-BBA6-DD6792FCA70BAmbassador.jpg" name="img">

    <cfset w = imageGetWidth(img)>

    <cfset h = imageGetHeight(img)>

    <cfif w LT h>

        <cfset r = round((h-w)/2)>

        <cfset imageCrop(img, 0, r, w, w)>

    <cfelse>

        <cfset r = round((w-h)/2)>

        <cfset imageCrop(img, r, 0, h, h)>

    </cfif>

  <!--- Create new image object to represent cropped image--->

    <cfset croppedImg = imageNew(img)>

    <cfset imageResize(croppedImg, 54, 54)>

    <cfimage source="#croppedImg#" action="write" destination="D:\inetpub\abcd\images\2DD425CD-9AED-4182-BBA6-DD6792FCA70BAmbassador.jpg" overwrite="yes" quality="1">

<cfcatch type="any">

        <cfdump var="#cfcatch#" output="D:\inetpub\abcd\dumpfil.html" format="html">

</cfcatch>

</cftry>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 04, 2015 Oct 04, 2015

Copy link to clipboard

Copied

Unfortunately there is no way to test your idea as once imageCrop is included in the code, the operation halts at that point.

For example, to get the image in my previous post, I changed the code to:

<cfif w/h LT 1>

        <cfset r = round((h-w)/2)>

        <cfdump var="#variables#" output="D:\inetpub\abcd\dumpfil.html" format="html">

        <cfset imageCrop(img, 0, r, w, w)>

    <cfelse>

        <cfset r = round((w-h)/2)>

        <cfdump var="#variables#" output="D:\inetpub\abcd\dumpfil.html" format="html">

        <cfset imageCrop(img, r, 0, h, h)>

    </cfif>

However if I change the code to this :

<cfif w/h LT 1>

        <cfset r = round((h-w)/2)>

        <cfset imageCrop(img, 0, r, w, w)>

        <cfdump var="#variables#" output="D:\inetpub\abcd\dumpfil.html" format="html">

    <cfelse>

        <cfset r = round((w-h)/2)>

        <cfset imageCrop(img, r, 0, h, h)>

        <cfdump var="#variables#" output="D:\inetpub\abcd\dumpfil.html" format="html">

    </cfif>

-- then no dump file is created and no further code is processed.

In other image upload files the end sizes are not squares, so the way w, h, and r are calculated is slightly more complicated. Square is the simplest, which is why I chose this one. But they all include imageCrop, and they all fail now, where they were previously working.

The server hosts say they have not made any changes to the server, but I noticed that Java released a new version recently, which probably would update automatically on the server. I'm wondering if the new Java version has some change that upsets imageCrop.

In a previous post I said:

- - I have found one other clue since original posting. If I use an image that has spaces in the file name, with imageCrop commented out the other parts work, but when imageCrop is included, I get a server error 500. - -

This is not correct. Running this test file in certain browsers (e.g. Edge)  when imageCrop is included, the browser always returns server error 500. I am using Firefox which shows no error.

Doug

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2015 Oct 05, 2015

Copy link to clipboard

Copied

Odd indeed. What is your Coldfusion version?

You could

1) Look into Jamo's suggestion.

2) Check whether there have been changes in the ColdFusion server settings, configuration or version.

3) Perform the following test:

a) Create a test directory and create in it an Application.cfc file containing,

<cfcomponent>

<cfscript>

    this.name = "imageTest";

    this.applicationTimeout = "#createTimespan(1,0,0,0)#";

    this.sessionManagement = "true";

    this.sessionTimeout = "#createTimeSpan(0,0,20,0)#";

    this.setClientCookies = "true";

</cfscript>

<cffunction name="onApplicationStart" returntype="boolean">

    <cfreturn true>

</cffunction>

</cfcomponent>

b) Make a copy the file, D:\inetpub\abcd\images\2DD425CD-9AED-4182-BBA6-DD6792FCA70BAmbassador.jpg, say, testImage.jpg, and move the copy into the test directory.

c) Create in the test directory the file, test.cfm, containing the following code, and run it.

<cftry>

    <cfimage source="absolute_path_to_test_image" name="img">

    <cfset w = imageGetWidth(img)>

    <cfset h = imageGetHeight(img)>

    <cfif w LT h>

        <cfset r = round((h-w)/2)>

        <cfset imageCrop(img, 0, r, w, w)>

    <cfelse>

        <cfset r = round((w-h)/2)>

        <cfset imageCrop(img, r, 0, h, h)>

    </cfif>

    <cfset imageResize(img, 54, 54)>

    <cfimage source="#img#" action="write" destination="absolute_path_to_test_image" overwrite="yes">

<cfcatch type="any">

        <cfdump var="#cfcatch#" output="D:\inetpub\abcd\dumpfil.html" format="html">

</cfcatch>

</cftry

Do you get a cropped image?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 07, 2015 Oct 07, 2015

Copy link to clipboard

Copied

OK tried everything you suggested, but result is the same.

The cropped image does not get saved to the test directory unless I comment out the imageCrop lines.

The server is running ColdFusion 10 or it was - the server hosts are not very forthcoming and I'm certain they've changed something, but they still say they haven't. I think it is possible that we've been moved from a physical server to a Cloud server which could be running ColdFusion 11. I'm trying to get a definite answer from them.

We are separately looking into Jamo's suggestion to get things working again, but I would still like to know what has gone wrong here.

Doug

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 07, 2015 Oct 07, 2015

Copy link to clipboard

Copied

Use the advice here to determine the version of ColdFusion that is being used.
http://www.bennadel.com/blog/140-ask-ben-checking-the-coldfusion-version.htm

<cfdump var="#SERVER#">

It sounds like you are attempting to perform an "AspectCrop".  Have you tried using Ben Nadel's ImageUtils library?:
http://imageutils.riaforge.org/‌

http://www.bennadel.com/resources/demo/imageutils/demos/aspectcrop.cfm

If willing, send the photo in question to me and I'll attempt the crop using CF9/10.  (Sometimes the errors ColdFusion thrown are due to the image and not the CFML.)

https://about.me/jamesmoberg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 07, 2015 Oct 07, 2015

Copy link to clipboard

Copied

Thanks for that.

So we are still on ColdFusion 10 version 10,0,0,286680 and Windows Server 2008 R2 - apologies to the server hosts. And the server hosts have now acknowledged the fault and are looking into it, so maybe they will be able to provide some solution.

If no luck with that we'll try installing Ben Nadel's ImageUtils library. Or switch to your solution which may ultimately be the best as it works outside CF forestalling any future problems.

This is the image, though I see it has been scaled by this program. The original size was 1500 x 725px.

2DD425CD-9AED-4182-BBA6-DD6792FCA70BAmbassador.jpg

The thumbnail created when the program was working, looks like this :

2DD425CD-9AED-4182-BBA6-DD6792FCA70BAmbassador.jpg

Doug

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 08, 2015 Oct 08, 2015

Copy link to clipboard

Copied

I applied your code to your picture, using Coldfusion 11. The result follows.

2DD425CD-9AED-4182-BBA6-DD6792FCA70BAmbassador.jpg

Click on the image to enlarge it to its real size, 54px * 54px. Then, to copy it, right-click and select Save Image As.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 08, 2015 Oct 08, 2015

Copy link to clipboard

Copied

Yes you're right it only fails on our server. I am still awaiting a reply from our server hosts as to the cause of the problem. I suspect they have implemented some new security rule which somehow prevents imageCrop loading the image. But I am still hopeful they will at least be able to explain why imageCrop now fails.

Doug

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 08, 2015 Oct 08, 2015

Copy link to clipboard

Copied

Working with the smaller, resized image isn't the same as working with the original.  I had recently reviewed CF10 image processing issues regarding a large 20mb JPG that was uploaded by a client.  The upload worked fine, but imageRead() consistently threw a JAVA HEAP error.  Using TRY/CATCH around the imageRead block doesn't do anything either; the error is thrown and there's no way to catch it.

If a user uploads a very large photo using a newer smart phone, it's possible that ColdFusion could throw an error due to it being too large.  It's it's not an issue of the image being too large, performance will still be poor and will take too long to process.  You could probably install more RAM and hope that it solves the problem, but what happens when multiple images are being processed by multiple users?  GraphicsMagic processed the image quickly without any memory issues or CF errors.  We haven't had any server stability issues or downtime since switching all image functions to GM.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 08, 2015 Oct 08, 2015

Copy link to clipboard

Copied

I agree. GraphicsMagic looks good and we will change all our CF image processing to that. Thanks for that.

I will post the result if the server hosts do find out what has gone wrong on our server.

Doug

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 10, 2015 Oct 10, 2015

Copy link to clipboard

Copied

Doug777

You should do the following test, using the 1500px * 725px image above. As a formality to rule out a bug.

imgTest1.cfm

<cfimage source="D:\inetpub\abcd\images\2DD425CD-9AED-4182-BBA6-DD6792FCA70BAmbassador.jpg" name="img">

<cfimage source="#img#" action="writeToBrowser">

imgTest2.cfm

<cfimage source="D:\inetpub\abcd\images\2DD425CD-9AED-4182-BBA6-DD6792FCA70BAmbassador.jpg" name="img">

<cfset imageCrop(img, 388, 0, 725, 725)>

<cfimage source="#img#" action="writeToBrowser">

Any joy?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 10, 2015 Oct 10, 2015

Copy link to clipboard

Copied

The first test downloads the image into the browser. Wow, looks fantastic, wish I was there!

The second test has only a blank page, no error, no result at all.

So I think that proves there's a server 'fault' of some sort.

Thanks,

Doug

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 14, 2015 Oct 14, 2015

Copy link to clipboard

Copied

Our server hosts have sent me the fault that is generated when your second test is run. There doesn't seem to be any problem till it reaches the part I've put in bold.

Oct 14, 2015 9:42:08 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [CfmServlet] in context with path [/] threw exception [Could not initialize class javax.media.jai.JAI] with root cause
java.lang.NoClassDefFoundError: Could not initialize class javax.media.jai.JAI
  at coldfusion.image.Image.crop(Image.java:1033)
  at coldfusion.runtime.CFPage.ImageCrop(CFPage.java:7152)
  at cfimgtest22ecfm1236136812.runPage(D:\Inetpub\abcd\test\imgtest2.cfm:3)
  at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)
  at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)
  at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
  at coldfusion.filter.IpFilter.invoke(IpFilter.java:64)
  at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:428)
  at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
  at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
  at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
  at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
  at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
  at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
  at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
  at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)
  at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
  at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
  at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
  at coldfusion.CfmServlet.service(CfmServlet.java:219)
  at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
  at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)
  at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
  at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
  at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:166)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:299)
  at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:57)
  at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:193)
  at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
  at java.security.AccessController.doPrivileged(Native Method)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
  at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
  at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)
  at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
  at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
  at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:246)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:57)
  at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:193)
  at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
  at java.security.AccessController.doPrivileged(Native Method)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  at com.intergral.fusionreactor.filter.FusionReactorCoreFilter.doHttpServletRequest(FusionReactorCoreFilter.java:503)
  at com.intergral.fusionreactor.filter.FusionReactorCoreFilter.doFusionRequest(FusionReactorCoreFilter.java:337)
  at com.intergral.fusionreactor.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:246)
  at com.intergral.fusionreactor.filter.FusionReactorFilter.doFilter(FusionReactorFilter.java:121)
  at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)
  at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
  at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
  at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:246)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:57)
  at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:193)
  at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
  at java.security.AccessController.doPrivileged(Native Method)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)
  at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:204)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  at java.lang.Thread.run(Thread.java:662)


They are adamant that "there have been no security changes in policy or settings to the server, no core os changes, no updates,

nothing in the time you've started seeing this."

So as Jamo implied, there seem to be some problems in the Java behind cfimage.


Our server hosts are going to reinstall the jai jar files for us to see if that works. However, Jamo is right in saying these functions are unreliable.


Does anyone have any thoughts on why the above server error should suddenly start occurring?


Doug

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 17, 2015 Oct 17, 2015

Copy link to clipboard

Copied

Now we are on to something. Your provider might have changed the Java Virtual Machine or the classpath that ColdFusion uses.

See Java error using imageCrop and CF8.01 Enterprise 64 bit OS X JAI error

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 03, 2015 Nov 03, 2015

Copy link to clipboard

Copied

The server hosting company has replied :

"I fixed the noclassdef error.

I had to download the exact version of the jre that coldfusion had installed

and get the same JDK version, install it on a local test bed and copy over the tools.jar to

the lib folder for coldfusion.

Now I'm running into a lang initialization error."

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 05, 2015 Nov 05, 2015

Copy link to clipboard

Copied

LATEST

doug777 wrote:

The server hosting company has replied :

"I fixed the noclassdef error.

I had to download the exact version of the jre that coldfusion had installed

and get the same JDK version, install it on a local test bed and copy over the tools.jar to

the lib folder for coldfusion.

Now I'm running into a lang initialization error."

Your hosting company seems to be over-engineering the installation. They should just install ColdFusion normally. ColdFusion ships with an in-built JRE, which it will automatically use.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 02, 2015 Oct 02, 2015

Copy link to clipboard

Copied

What version of ColdFusion are you using?  If CF9, it could be failing because the uploaded JPG is CMYK. (If using CF10, valid CMYK images can still throw errors too.)  CMYK weirdness is the primary failure we've encountered when generating thumbnails.

As a result of CMYK bugs (and incredible slowness compared to alternatives), we've stopped using ColdFusion/Java for all image manipulation.  Do you have any control over what's installed on the remote server?  If so, consider installing GraphicsMagick as it processes more image types much faster (and is what Flickr uses.)

I've blogged about JPGs, ColdFusion, CMYK & GraphicsMagick here (including writing a CF9-11 Custom Tag):
http://gamesover2600.tumblr.com/search/graphicsmagick

NOTE: For thumbnail generation, we use CF_GraphicsMagick to perform an "aspect crop" with the following 1 line:

<CF_GraphicsMagick

     action="AspectCrop"

     Infile="#InFile#"

     outfile="#outFile#"

     width="440"

     height="260"

     result="imgData"

     quality="90">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 03, 2015 Oct 03, 2015

Copy link to clipboard

Copied

Thanks for reply. We can certainly try your suggestion.

But I would still like to know what could have changed that suddenly made all our upload files that include imageCrop stop working when they had been working for years.

Doug

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation