Skip to content
Snippets Groups Projects

Allow resizing sub elements

Merged Yoann Schneider requested to merge allow-resizing-subelements into master
2 files
+ 2
13
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 1
12
@@ -187,20 +187,9 @@ class Element(MagicDict):
if max_width is None and max_height is None:
resize = "full"
else:
bounding_box = polygon_bounding_box(self.zone.polygon)
original_size = {"w": self.zone.image.width, "h": self.zone.image.height}
# No resizing if the element is smaller than the image.
if (
bounding_box.width != original_size["w"]
or bounding_box.height != original_size["h"]
):
resize = "full"
logger.warning(
"Only full image size elements covered, "
+ "downloading full size image."
)
# No resizing if the image is smaller than the wanted size.
elif (max_width is None or original_size["w"] <= max_width) and (
if (max_width is None or original_size["w"] <= max_width) and (
max_height is None or original_size["h"] <= max_height
):
resize = "full"
Loading