-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Preview providers should take maxX and maxY into consideration #13607
Comments
Job done for all files using the bitmap preview class: #13635 |
Re-opening, as the Image provider is not taking the max dimensions into consideration |
Fix for all remaining providers is in #16382 |
You tagged this as regression, so this worked before ? |
Yes, before the max preview, each provider would be queried for each request and thus provide a preview matching the asked dimension. Since they're now only use to generate the max preview, we need to make sure those previews keep the aspect ratio of the original image. |
Yes, the API should now return the expected previews. |
awesome - thanks @oparoz for your contribution - very much welcome! |
Problem
The interface includes maX and maxY for a reason and yet, none of the providers use it.
A 5000x5000, 140MB TIFF is currently being converted to a 5000x5000 50MB PNG.
Fortunately, it will soon be possible to avoid multiple roundtrips to ImageMagick (via #13674) , but each resizing request of that 50MB PNG is still going to take some time (and waste memory) and that will only partially be fixed once #8196 is implemented.
Solution
Make sure preview providers take maxX and maxY into consideration when generating previews. With #13674 in place, each provider should only be called once.
I'm going to fix Bitmap, but the other providers should be fixed as well.
The text was updated successfully, but these errors were encountered: