You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upload a picture for example this one:
It has a resolution of 200×100.
Embed the picture in a page, setting height to e.g. 50.
The result is a picture with the name test2.png__80x50_q85_subsampling-2.jpg and the resolution of 40×40.
Why is that so?
When height is given, but width is not, width is calculated here:
elif not width and height:
width = int(height * PICTURE_RATIO)
This would be fine, if PICTURE_RATIO would actually be the ratio.
But PICTURE_RATIO, as capital letters suggest, is not calculated, but a constant, as you can see here.
It should be used, when not width nor height is given.
50×1.6=80 witch is, why the name contains 80x50.
Somewhere else, I don't know where, the actual size is calculated witch results in 80÷2=40 (40x40).
This is basically the same if only width is given.
But in this case, height is calculated wrongly, witch results in a wrong filename, but not in wrong actual size, because the actual size must be calculated somewhere only by resolution and width.
I haven't searched so far.
Please fix this issue.
The text was updated successfully, but these errors were encountered:
Width and height are calculated wrong, when only height is set and width is calculated.
Example
It has a resolution of 200×100.
The result is a picture with the name
test2.png__80x50_q85_subsampling-2.jpg
and the resolution of 40×40.Why is that so?
When height is given, but width is not, width is calculated here:
This would be fine, if
PICTURE_RATIO
would actually be the ratio.But
PICTURE_RATIO
, as capital letters suggest, is not calculated, but a constant, as you can see here.It should be used, when not width nor height is given.
50×1.6=80 witch is, why the name contains 80x50.
Somewhere else, I don't know where, the actual size is calculated witch results in 80÷2=40 (40x40).
This is basically the same if only width is given.
But in this case, height is calculated wrongly, witch results in a wrong filename, but not in wrong actual size, because the actual size must be calculated somewhere only by resolution and width.
I haven't searched so far.
Please fix this issue.
The text was updated successfully, but these errors were encountered: