mirror of
https://github.com/FAUSheppy/flask-json-dream-website
synced 2025-12-06 08:11:35 +01:00
allow fp numbers for scale
This commit is contained in:
@@ -257,8 +257,8 @@ def generatePicture(pathToOrig, scaleX, scaleY, encoding):
|
|||||||
x, y = image.size
|
x, y = image.size
|
||||||
if not scaleY:
|
if not scaleY:
|
||||||
scaleY = y
|
scaleY = y
|
||||||
scaleX = min(x, int(scaleX))
|
scaleX = min(x, round(float(scaleX)))
|
||||||
scaleY = min(y, int(scaleY))
|
scaleY = min(y, round(float(scaleY)))
|
||||||
|
|
||||||
# generate new paths #
|
# generate new paths #
|
||||||
newFile = "x-{x}-y-{y}-{fname}.{ext}".format(x=scaleX, y=scaleY, fname=filename, ext=encoding)
|
newFile = "x-{x}-y-{y}-{fname}.{ext}".format(x=scaleX, y=scaleY, fname=filename, ext=encoding)
|
||||||
|
|||||||
Reference in New Issue
Block a user