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

Stretched images due to failed aspect ratio calculation #22

Open
davelondono opened this issue Mar 16, 2015 · 0 comments
Open

Stretched images due to failed aspect ratio calculation #22

davelondono opened this issue Mar 16, 2015 · 0 comments

Comments

@davelondono
Copy link

Hi, so there's a problem which happens under some particular circumstances:

I have an unusual image size of 880x240 hard-crop (which i call Extra-Wide), which works fine for some images, but then others were not. I discovered that the images it was not working on were the ones that were under certain dimensions, the specific case: a 1127x750 photo. A extra-wide cropped image is being generated with the right dimensions (880x240) but the actual photo is weirdly stretched vertically.

After carefully looking, I noticed that the cropping tool was showing a slightly narrower (vertically) cropping box than on other images where it was working as expected. A closer inspection to the javascript generated had in its settings "aspectRatio: 4.6958333333333" when it should have been "aspectRatio: 3.6666666666667" as it did on other images.

This takes me to /lib/ManualImageCropEditorWindow.php, lines 114 to 122. Here the aspect ratio for the cropping box is being overwritten when its over a value from calculations made based on the minimum with and height of the previewer. The problem: it disregards the real aspect ratio for the cropping tool, and then the actual cropping process will have mismatched ratios (from the cropping tool and the actual one) resulting in a stretched image.

i have commented the above mentioned lines and this resolved the problem, however i do not know their original purpose, so worth having a look to fix it properly for the next release.

Thanks

@davelondono davelondono closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2024
@davelondono davelondono reopened this Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant