Author: jleroux
Date: Mon Feb 23 08:15:40 2009
New Revision: 746914
URL:
http://svn.apache.org/viewvc?rev=746914&view=revLog:
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