svn commit: r746914 - /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: r746914 - /ofbiz/trunk/applications/product/src/org/ofbiz/image/ImageTransform.java

jleroux@apache.org
Author: jleroux
Date: Mon Feb 23 08:15:40 2009
New Revision: 746914

URL: http://svn.apache.org/viewvc?rev=746914&view=rev
Log:
A patch from Eric De Maulde "Avoid error when an uncompatible original image is uploaded" (https://issues.apache.org/jira/browse/OFBIZ-2200) - OFBIZ-2200

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=746914&r1=746913&r2=746914&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/image/ImageTransform.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/image/ImageTransform.java Mon Feb 23 08:15:40 2009
@@ -293,13 +293,19 @@
                     imgUrlMap.put(sizeType, imageUrl);
         
                 } // scaleImgMap
-            } // sizeIter
-        }
+            } // sizeIter
+            
+            result.put("responseMessage", "success");
+            result.put("imageUrlMap", imgUrlMap);
+            result.put("original", resultBufImgMap);
+            return result;    
         
-        result.put("responseMessage", "success");
-        result.put("imageUrlMap", imgUrlMap);
-        result.put("original", resultBufImgMap);
-        return result;    
+        }else{
+            String errMsg = "Impossible to scale original image : " + filenameToUse;
+            Debug.logError(errMsg, module);
+            result.put("errorMessage", errMsg);
+            return ServiceUtil.returnError(errMsg);
+        }    
         
     } // scaleImageInAllSize