Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Width and height are calculated wrong, when only one of both is given #91

Closed
mogoh opened this issue Feb 11, 2020 · 2 comments
Closed
Assignees

Comments

@mogoh
Copy link
Contributor

mogoh commented Feb 11, 2020

Width and height are calculated wrong, when only height is set and width is calculated.

Example

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.

@FinalAngel
Copy link
Member

Will be fixed by #98

@fsbraun
Copy link
Member

fsbraun commented Sep 13, 2022

IS fixed by #100

@fsbraun fsbraun closed this as completed Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants