[Erp5-report] r31531 fabien - in /erp5/trunk/products: ERP5/Document/ ERP5Form/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Dec 30 10:04:21 CET 2009


Author: fabien
Date: Wed Dec 30 10:04:18 2009
New Revision: 31531

URL: http://svn.erp5.org?rev=31531&view=rev
Log:
width, height order was not consistent everywhere

getSizeFromImageDisplay method was returning (heigh, width), but all other
 methods were returning (widht height). In addition to this, there was
 mistakes :
from Document/Image.py +295 :
                        'width': self.getSizeFromImageDisplay(id)[0],
                        'height': self.getSizeFromImageDisplay(id)[1],
and also l 450:
      (width, height) = self.getSizeFromImageDisplay(display)

the use of width and height was mixed up.
Currently, all default preferences display size define squares (width = heigh),
 so this mistake was never detected.

Modified:
    erp5/trunk/products/ERP5/Document/Image.py
    erp5/trunk/products/ERP5Form/ImageField.py

Modified: erp5/trunk/products/ERP5/Document/Image.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Image.py?rev=31531&r1=31530&r2=31531&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Image.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Image.py [utf8] Wed Dec 30 10:04:18 2009
@@ -513,7 +513,7 @@
       width_preference = 'preferred_%s_image_width' % (image_display,)
       height = preference_tool.getPreference(height_preference)
       width = preference_tool.getPreference(width_preference)
-      return (height, width)
+      return (width, height)
     return None
 
   def _setFile(self, *args, **kw):

Modified: erp5/trunk/products/ERP5Form/ImageField.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/ImageField.py?rev=31531&r1=31530&r2=31531&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/ImageField.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/ImageField.py [utf8] Wed Dec 30 10:04:18 2009
@@ -149,7 +149,7 @@
 
       # set the size of the image
       if display is not None:
-        height, width = image_object.getSizeFromImageDisplay(display)
+        width, height = image_object.getSizeFromImageDisplay(display)
         width, height = image_object._getAspectRatioSize(width, height)
         if draw_frame_node.attrib.get('{%s}width' % SVG_URI, {}) != {} and \
         draw_frame_node.attrib.get('{%s}height' % SVG_URI, {}) != {}:




More information about the Erp5-report mailing list