Avoid some bad combinations of default values
- Avoid setting image.fixedsize default True when image.scale is specified different than "true" or "both" by the user. - Avoid calculating the missing dimension unless image.fixedsize is actually True. It might have been specified False by the user.
This commit is contained in:
parent
c21707980e
commit
285a28dff6
@ -28,8 +28,11 @@ class Image:
|
||||
else "true" # When only one dimension is specified.
|
||||
|
||||
if self.fixedsize is None:
|
||||
self.fixedsize = self.width or self.height
|
||||
# Normally equal to (self.width or self.height), but the user might override self.scale.
|
||||
self.fixedsize = str(self.scale).lower() in ["true", "both"]
|
||||
|
||||
if self.fixedsize:
|
||||
# If only one dimension is specified, compute the other because both are required.
|
||||
if self.height:
|
||||
if not self.width:
|
||||
self.width = self.height # Assuming 1:1 aspect ratio for now.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user