svn commit: r749217 - /ofbiz/trunk/applications/product/src/org/ofbiz/image/ImageTransform.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r749217 - /ofbiz/trunk/applications/product/src/org/ofbiz/image/ImageTransform.java

jleroux@apache.org
Author: jleroux
Date: Mon Mar  2 07:53:39 2009
New Revision: 749217

URL: http://svn.apache.org/viewvc?rev=749217&view=rev
Log:
A patch from Eric De Maulde "Unknown buffered image type for PNG image" (https://issues.apache.org/jira/browse/OFBIZ-2216) - OFBIZ-2216

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/image/ImageTransform.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/image/ImageTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/image/ImageTransform.java?rev=749217&r1=749216&r2=749217&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/image/ImageTransform.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/image/ImageTransform.java Mon Mar  2 07:53:39 2009
@@ -367,13 +367,17 @@
             result.put("errorMessage", errMsg);
             return result;
         }
+        int bufImgType;
         if (BufferedImage.TYPE_CUSTOM == bufImg.getType()) {
             String errMsg = UtilProperties.getMessage(resource, "ImageTransform.unknown_buffered_image_type", locale);
-            Debug.logError(errMsg, module);
-            result.put("errorMessage", errMsg);
-            return result;            
+            Debug.logWarning(errMsg, module);
+            // apply a type for image majority
+            bufImgType = BufferedImage.TYPE_INT_ARGB_PRE;
+        }else{
+            bufImgType = bufImg.getType();      
         }
-            bufNewImg = new BufferedImage( (int) (imgWidth * scaleFactor), (int) (imgHeight * scaleFactor), bufImg.getType());
+        
+        bufNewImg = new BufferedImage( (int) (imgWidth * scaleFactor), (int) (imgHeight * scaleFactor), bufImgType);
 
         result.put("responseMessage", "success");
         result.put("bufferedImage", bufNewImg);