win32ss / supermium

Chromium fork for Windows XP/2003 and up
https://win32subsystem.live/supermium/
BSD 3-Clause "New" or "Revised" License
1.83k stars 60 forks source link

Images defaulting to WEBP rather than JPEG/PNG? #679

Open Darthagnon opened 1 week ago

Darthagnon commented 1 week ago

Describe the bug I'm wondering if it's some new Chromium behaviour, but I've noticed that when saving images via right-click >> Save as, I get a WEBP image in Supermium, but the same image in an older version of Ungoogled Chromium (v90) is offered as a PNG or JPEG

To Reproduce Steps to reproduce the behavior:

  1. Go to a website with an image, even say httpx://dankmemes.com/funny_meme.jpeg. Old Reddit frontpage images are a good example.
  2. Right-click >> Save as
  3. You will be offered funny_meme.webp, which is compressed, lower quality, and not as widely supported in the OS
  4. Expected behaviour is to get funny_meme.jpeg, as that is the URL path

As a workaround, at the moment I use Image Downloader whenever I want to download an image

Screenshots

Supermium WEBP bug

Desktop (please complete the following information):

Darthagnon commented 1 week ago

I thought it might be a useragent issue, but apparently Chrome now defaults to WebP (since June 2024)

This is an anti-feature, as WEBP is not supported by default by the operating system and cannot be used for wallpapers or photo editing software (without plugins)

belext commented 1 week ago

Note: I'm just random user, but IMO this is certainly not Supermium's bug and the issue itself is poorly described.

Why You shouldn't mention some non-existing `httpx://dankmemes.com` website (not a valid URL) when describing the steps. Don't make developers spend additional time to reproduce the problem. Also editing the issue template without a reason is discouraged. For example, you put "Expected behavior" as part of "To Reproduce" block. Though in this case bug template shouldn't have been used at all, since the same behavior can be seen in Chromium 122+.

Example of good steps for this issue:

  1. Open Reddit's homepage, find a post with an image (for example, this one), expand or open it (alternatively, just click this Telegraph image: zaha-hadid-heydar-aliyev.jpg)
  2. Right click and try to "Save image as..."
  3. Observe that it's a .webp image

WebP is not an anti-feature, it's just an optimized image format. You can read more about it here, here and here. Or somewhere else if don't trust Google's opinion. The fact that you can't easily edit .webp images or set them as wallpapers doesn't mean the format itself is bad. For example, you can't open favicon.ico files in Photoshop by default, but it doesn't make favicons an anti-feature as well.

Anyway, you can try to tell websites not to serve you WebP images by adjusting the Accept header of all the requests. I found that Supermium has a built-in flag from ungoogled-chromium: chrome://flags/#http-accept-header Copy the default header from DevTools and remove image/webp from it:

text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7

After relaunching the browser and doing a hard refresh (Ctrl+F5), the Telegraph image above loaded as JPG for me. However, it didn't help with Reddit even after I spoofed user agent as Chrome 90.

I did try a portable version of ungoogled-chromium v90 and can confirm that Reddit images are loaded as JPGs there by default. But the Telegraph image still loaded as a WebP, because Accept headers include image/webp even in Chromium v90. In fact, it's been there since 2013 at least (see 40298382), so it's not a recent change. It means that there's no clear logic how Reddit's CDN picks what format to serve. So it's unlikely that Supermium dev can do anything about it.

In general, I think you should look into extensions such as maxurl. For Reddit anything coming from preview.redd.it will be worse than the original image. And you can't get to this URL by disabling WebP in a browser. Image Downloader extension you mentioned probably just converts one format to another, so it won't give you better quality, while maxurl can at least try to do it.

If no source image could be found, you can also try the easiest trick: just add any random GET parameter after .webp, for example image.webp?asdf. If no one else opened this URL before, CDN will send you a source image instead of loading it from cache.

XakerTwo commented 1 week ago

NOT A BUG NOT A BROWSER ISSUE

just spreading of webp as the default format depends on what is returned by server. UA is just hint for what is supported by browser. UA hints was intended for backwards compatibility, but as always all went back-forward and it became feature forcability. So generally it's CDN issue with abusing UA and/or with optimizing data size.

As example, image from first message here - suggested format is png, although image/webp is include in Accept header

As for Reddit and Telegraph - for me overriding Accept header with image/avif,image/apng,image/svg+xml,image/*,*/*;q=0.8 via extension solve the webp "issue" (caution - probably linked extension turned into shit, personally i use v6.0.6 and has no ads, mentioned in reviews, also you need to put some filters or it can breaks e.g. github) original header content - image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8


And IMHO about > The fact that you can't easily edit .webp images or set them as wallpapers doesn't mean the format itself is bad. For example, you can't open `favicon.ico` Hell it does this format bad, especially after 14 years of exists with statement "... by Google intended as a replacement for JPEG, PNG, and GIF file formats ..." (wiki; there no statement "in web space only" so it should be widely supported outside browser) You can view and edit `PNG` or `JPEG` even in MS 95 Paint. `GIF` is kind of interesting shit - you can view(sometimes only as static image), but editing/creating require soft(mean proper editing without losing any feature), fortunately there a lot. Same for `ICO`(`BMP32`) - it can be viewed but proper editing require soft. But this is not an end-user format, it's mostly for icons. What about `WebP` - 2010-2013 some specific viewing soft add support, 2019-NOW major soft continue to add support of it. w11 native support - NO it's fiasco for `WebP` as for `JPEG` and `PNG` replacement
Darthagnon commented 1 week ago

@belext

You shouldn't mention some non-existing httpx://dankmemes.com website (not a valid URL)

I mentioned a nonexistent website to simplify the URL descriptions. Is really that much more helpful if I cite something like https://preview.redd.it/pyv3ewno7j7d1.png?width=604&auto=webp&s=7cd6757f930ff27fe0e704dd9d615fdbd1380df1, which served (doesn't seem to, currently) a PNG on Ungoogled Chromium 90 and all my other web browsers, and a WEBP on Supermium 122 R6? And also because the undesired behaviour seems a bit hit or miss/inconsistent: I don't know what websites will serve me a WEBP when the URL suggests it should be JPG/PNG. Some links seem to change between what is delivered randomly in Supermium, but not in ancient Chromium. Only that the behaviour is now very widespread, and does not appear when I visit those same websites in older Chromium.

I know WEBP is "technically superior", but when I right-click an image and open in new tab and go down the URL tree and receive a URL ending in JPG/PNG and right click save as, it's not because I'm looking for the most compressed, highly-optimised version of the image (That's what the website should be serving on the homepage), it's because I'm looking for the best quality, least compression available to use as a wallpaper or for archival.

@XakerTwo @belext The workarounds you mention are very complex, undocumented (until now) and require insecure extensions to restore what should be default behaviour. How do I explain all that to my parents/grandparents when they want to save a good quality image to use as a wallpaper?

In general, I think you should look into extensions such as maxurl. For Reddit anything coming from preview.redd.it will be worse than the original image. And you can't get to this URL by disabling WebP in a browser. Image Downloader extension you mentioned probably just converts one format to another, so it won't give you better quality, while maxurl can at least try to do it.

Thank you for explaining those advanced techniques, though. Image Downloader can convert from one to another, but as far as I see makes it clear when it does so, so that you can avoid it converting formats. I will try maxurl.