You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/02/23 09:15:41 UTC

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

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 
 



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

Posted by Jacques Le Roux <ja...@les7arts.com>.
Actually I'm refactoring all the file. There were much more than that missing (even if it works well). Though I think I will ask 
Eric for this particular feature ;o)
Related to this effort I will update Jdom

Jacques

From: "Adrian Crum" <ad...@hlmksw.com>
> Shouldn't the error message be internationalized?
>
> -Adrian
>
> jleroux@apache.org wrote:
>> 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
> 



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

Posted by Adrian Crum <ad...@hlmksw.com>.
Shouldn't the error message be internationalized?

-Adrian

jleroux@apache.org wrote:
> 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 
>  
> 
> 
>