-
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
Fix for thumbnail creation on File upload OC version 81.beta #16355
Conversation
If you upload an image that is greater than the config value of preview_max_x/preview_max_y (2048) you run in an issue that the big image also get cropped to 2048 x 2048 cause the first small thumb creation is square 36/36 so the keepAspect is false. with this addition you ge sure the aspect ratio is set to true!
A new inspection was created. |
@libasys - You're right. It's only a problem with the image provider though, so maybe it's best to only fix that provider so that it actually resizes images instead of just encapsulating them in a OC_Image object? You could add What do you think @georgehrke ? Also, the test needs fixing and there should be an additional file format, like a psd file, because the providers are not the same. |
@oparoz that's a problem of the files app, if you upload a new image in the file app, it automatically creates the 2 images 36&36 px and the max size, or i am wrong? |
When you upload a file, the Preview class will ask the registered provider to provide a preview of the file and that provider should return a preview which fits the max dimensions and keeps the aspect ratio. The mechanism is described here: #13607 |
Unit tests are failing:
|
@oparoz can you fix this issue you are more familiar to the preview class! I think it is really important, cause many users upload pictures to the files app and wondering why there images if the maxX or maxY is greater than the config value are cropped and not resized! Thanks in advance |
OK, I will, but you will miss your opportunity to learn more about that class ;) |
lol at the moment i maintain about 7 apps, and make sure that's enough work for myself ;) |
If you upload an image that is greater than the config value of preview_max_x/preview_max_y (2048) you run in an issue that the big image also get cropped to 2048 x 2048 cause the first small thumb creation is square 36/36 so the keepAspect is false. with this addition you ge sure the aspect ratio is set to true!