pachli / pachli-android

The Pachli Android app
https://pachli.app
GNU General Public License v3.0
120 stars 15 forks source link

add option to show preview images with full resolution or prevent previews from being reduced too much #465

Closed foss- closed 8 months ago

foss- commented 8 months ago

Is your feature request related to a problem? Please describe. Currently image previews, not always but frequently enough to be a nuisance, are shown blurry. Is it possible to prevent this from happening?

Describe the solution you'd like Don't reduce image previews to the point where they become a blurry pixel mess.

Additional context Android 13.1 Pachli Current 2.2.0+2162e03e

Edit: question: is it possible to not resize the image preview, which may cut off important information? I think I'd rather see an odd format not cut off, than only a fragment of an image which may make it impossible to understand what is going on in the image.

nikclayton commented 8 months ago

[ The original post is https://hachyderm.io/@thisismissem/111955187861727663 if you need to search for this on your server ]

What server is this? Pachli is showing the preview image generated/hosted by your server here. When I look at this from my mastodon.social account it's nowhere near as blurry, and looks like this:

image

Even if the preview on your server wasn't blurry I'm not sure that showing the full width preview is an improvement in this case. It's kind of pathological, as the image is so wide. Here's a mock up of what it would look like if Pachli showed the image full width:

image

For large images posters are supposed to set the "focal point", the main area of interest in the image so that if clients do have to crop it they can do so intelligently and ensure the important information is still visible in the thumbnail.

That breaks down here I think.

  1. I don't think it was set
  2. It's not obvious in an image like this where the best focal point is
  3. Your server renders the image so blurry that the focal point wouldn't be helpful anyway

Thoughts?

foss- commented 8 months ago

Should have included original link and server info in report.

Post: https://hachyderm.io/@thisismissem/111955187861727663 Server: This is Friendica, version 2024.03-rc that is running at the web location https://pirati.ca. The database version is 1554/1554, the post update version is 1550/1550.

There were a few changes around image handling e.g. https://github.com/friendica/friendica/pull/13900 will have to observe this some more to learn if this was a one time off.

What's interesting is, when searching https://hachyderm.io/@thisismissem/111955187861727663 in friendica web UI, the post and screenshot show in great quality: 1

When searching for the same post in Pachli Current it still shows the blurry image preview. So maybe a Pachli behavior or friendica is (again) doing something wrong in regards to mastodon API?

It is interesting, clicking the image loads the full resolution. Going back to the post and we're back to blurry image.

Could you retry with your pirati.ca account and see how the image in the post in question shows for you then?

nikclayton commented 8 months ago

Yeah, it's a server thing. If I fetch that post from pirati.ca using the API I get back this:

...
    "media_attachments": [
        {
            "id": "24001598",
            "type": "image",
            "url": "https://pirati.ca/photo/preview/24001598",
            "preview_url": "https://pirati.ca/photo/preview/320/24001598",
            "remote_url": "https://media.hachyderm.io/media_attachments/files/111/955/187/640/426/755/original/1db8ae3d5706e2b2.jpeg",
            "text_url": "https://media.hachyderm.io/media_attachments/files/111/955/187/640/426/755/original/1db8ae3d5706e2b2.jpeg",
            "description": "Temporarily in dust \n\n12/28/2023 5:42 AM\n\nTroll co-prosperity sphere nuke tool soon A new browser-only trolling tool (complete with Joiner , Sender , WebhookSpammer , random , and more ) will be released \nThis allows you to vandalize from school, before bed, on your smartphone, or on your 3DS\n",
            "blurhash": "|25EU7}tSvJCJ6I:RjoNocSkXSxuxtslaebGozozD~WTs;oMogogj]a#og$+i^InRkkDflazWCWBER9aNFs.sCniaxkBRj$*slRlNHNHR*RjV@aeNdbwbIjZaeRiWAjYj@t9kDbHofoLaxocofoexZadWCbct7tRofofoe",
            "meta": {
                "original": {
                    "width": 1992,
                    "height": 338,
                    "size": "1992x338",
                    "aspect": 5.893491124260355
                }
            }
        }
    ],
...

The preview URL is https://pirati.ca/photo/preview/320/24001598, and if you open that you get a very blurry image (downscaled to 320px I'm guessing).

Interestingly the Friendica web UI embeds a different preview image if you search for the post on the web; that preview URL is https://pirati.ca/photo/preview/640/24001598. The 640 part of the URL appears to be a width selector, so the web UI gets a preview image that's twice as wide as the one served to API clients.

In testing you can set it to what seems to be any arbitrary value.

I'll create an issue over in the Friendica repo and see what the devs over there say.

nikclayton commented 8 months ago

Looks like this will be fixed on the Friendica side with https://github.com/friendica/friendica/pull/13931

nikclayton commented 8 months ago

@foss- Friendica have fixed this in https://github.com/friendica/friendica/pull/13931

Does that resolve it for you, or are there other things you think Pachli should do?

foss- commented 8 months ago

Thanks for the ping. I am waiting for the change to land on pirati.ca in order to verify. This isn't actionable on Pachli side of things, so lets close the issue.

Nik, thanks so much for engaging and digging into these reports instead of just saying "notourbug", which would still be correct. Your input did help find some long standing issues in friendicas use of API and the fact that friendica keeps resolving the reported issues is great. I wish more devs in the Fediverse space had such a mindset (👀 at you Mastodon).