-
Notifications
You must be signed in to change notification settings - Fork 319
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
[Bug report] Thumbnail size might respect the given value regardless of the aspect ratio #1135
Comments
Could you make a bisect to determine what is the last commit that works for you? |
Hello Alex, I eventually noticed that thumbs are never squared whatever is the original file. Can you test it by removing any fit in the widget used to display the thumb images inside the grid? Coz they look squared only because of the fit effect. |
Which grid? The plugin did not provide any grid AFAIK |
My bad, but it is not required. You can just print width and height of the returned thumbnail, it is not a squared image, whatever the original pic. |
Hello @AlexV525 @CaiJingLong Here is what we are doing to create a squared thumbnail
Above code returns a On the contrary, the official way to get it, doesnt. More precisely, the returned image size is 350x350px but there is a black inner area inside the image and the real image content is not really squared.
Hope this helps. |
Is that critical? IMO using BoxFit.cover should regardless of the image size. |
Yes. The black area inside the image is "part of the image itself", hence BoxFit.cover cannot do the job (the "cover" fit property is already applied when black area is shown). The BoxFit trick would work if If photo_manager is square-cropping thumbs on dart side, you could try to integrate our code, or if the crop occurs on native side you could try to see what's wrong with that part. |
So it only takes place on certain assets rather than all of them right? From your screenshot all other images are displayed well. |
No that was done on purpose. You can try this sample code. Time passed by and I dont remember well, but with one version the thumb was not squared at all, and with another version the thumb was squared wrongly (with the black inner area). |
I've tested with all my existing assets and none of them were clipped as your case shows. |
Can you share here your sample code for testing? I will run it and lyk the results on my devices. In our code we just do this and the log print non-squared values.
|
Hello Alex, we checked again and this issue still occurs for us. |
Version
3.1.1
Platforms
Android, iOS
Device Model
Xiaomi mi lite 5g and iphone 13 pro
flutter info
How to reproduce?
Pick an horizontal image and get the entity thumbnail as square.
The result image is not squared.
Note: in a previous version of the plugin, result image was squared but a black are was filled in.
I guess there is an issue with the crop.
Logs
No response
Example code (optional)
No response
Contact
No response
The text was updated successfully, but these errors were encountered: