jhass / insporation

Flutter based client for diaspora*
BSD 3-Clause "New" or "Revised" License
30 stars 3 forks source link

Shared images are too small #58

Closed oliverk71 closed 2 years ago

oliverk71 commented 2 years ago

Whenever I share images via my gallery app to the insporation+ app, the images are very small. This does not happen if I open the Insporation+ app and select and share an image directly.

jhass commented 2 years ago

Is sharing via your gallery app to other apps fine too?

oliverk71 commented 2 years ago

Is sharing via your gallery app to other apps fine too?

Yes, it is perfectly fine, if I share with other apps, for example messengers.

jhass commented 2 years ago

Damn, looks like the library I use for downsizing there just halfs the dimensions until they fit under the limits :man_facepalming:

https://github.com/lykhonis/image_crop/blob/04635f1d9b85aa35bebac75ac1a9cb88d1ea40ba/android/src/main/java/com/lykhonis/imagecrop/ImageCropPlugin.java#L319-L332

oliverk71 commented 2 years ago

I don't believe this is the only reason, because it is smaller than just the half. I shared a image with you for demonstration.

jhass commented 2 years ago

It can easily end up smaller than half. I put a maximum width of 900px currently. Say your image is 1900px wide, half of that is 950px, which is still too big, so the algorithm halves again and ends up downscaling to 475px.

The compounding factor was that I precalculated the optimal height too because the library required giving a maximum for both.