Skip to content
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

The biggest picture size not found and a possible false detection #29

Open
drws opened this issue Aug 10, 2022 · 2 comments
Open

The biggest picture size not found and a possible false detection #29

drws opened this issue Aug 10, 2022 · 2 comments

Comments

@drws
Copy link

drws commented Aug 10, 2022

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.

@jscher2000
Copy link

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.

@drws
Copy link
Author

drws commented Aug 11, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants