Commit f2c35313 authored by Fabien Morin's avatar Fabien Morin

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.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31531 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e152903c
...@@ -513,7 +513,7 @@ class Image(File, OFSImage): ...@@ -513,7 +513,7 @@ class Image(File, OFSImage):
width_preference = 'preferred_%s_image_width' % (image_display,) width_preference = 'preferred_%s_image_width' % (image_display,)
height = preference_tool.getPreference(height_preference) height = preference_tool.getPreference(height_preference)
width = preference_tool.getPreference(width_preference) width = preference_tool.getPreference(width_preference)
return (height, width) return (width, height)
return None return None
def _setFile(self, *args, **kw): def _setFile(self, *args, **kw):
......
...@@ -149,7 +149,7 @@ class ImageFieldWidget(Widget.TextWidget): ...@@ -149,7 +149,7 @@ class ImageFieldWidget(Widget.TextWidget):
# set the size of the image # set the size of the image
if display is not None: if display is not None:
height, width = image_object.getSizeFromImageDisplay(display) width, height = image_object.getSizeFromImageDisplay(display)
width, height = image_object._getAspectRatioSize(width, height) width, height = image_object._getAspectRatioSize(width, height)
if draw_frame_node.attrib.get('{%s}width' % SVG_URI, {}) != {} and \ if draw_frame_node.attrib.get('{%s}width' % SVG_URI, {}) != {} and \
draw_frame_node.attrib.get('{%s}height' % SVG_URI, {}) != {}: draw_frame_node.attrib.get('{%s}height' % SVG_URI, {}) != {}:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment