Open drws opened 2 years ago
Hi, I'm a stranger watching issues on this repository.
Regarding AVIF, unless something has changed recently, it's difficult for extensions to determine the true format of an image in a page without re-requesting it and watching the server's report of the Content-Type of the response (or analyzing the first few bytes of the binary file). But perhaps more importantly, that information in itself would not help you get the original JPEG. You'll notice in the URL that it has format=auto
. If you manually change that to format=jpeg
-- or if you remove the format=auto
completely -- then you get the .jpg file. But I don't know whether this is a common feature of image servers or something specific to this site.
I understand it is difficult to reliably detect format. Maybe it would be possible to only download HTTP headers for each image, a first few bytes if needed and not request the whole file, but that is detectable server-side and should probably be added as an additional option if it is even a good idea.
I did notice format=auto
, but as I reported JPEG only gets delivered if the parameter is removed, format=jpeg
does not help in my case. I even tried Ctrl+F5
to clear the cache. I'm not sure whether behind! notices this and tries some of the mentioned URL hackery, but removing parameters (checking the base image URL) could be a useful idea.
The site-in-question is a random Decathlon product site such as this one. If behind! is used on the first product picture (thumbnail on the left), the biggest picture detected is JPEG 800x800. If it is used on the scaled up image, it is JPEG 969x969 (same as with
Open Image in New Tab
). Now the first issue is that even though JPEG is detected, AVIF gets delivered even when image is selected through behind!.The second issue is that behind! doesn't find the biggest available size. If parameters are removed from URL, this is the base address of the picture. In this case the full JPEG is downloaded with the size of 2500x2500.