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

Misnamed images on NHentai #346

Open
ale5000-git opened this issue May 24, 2024 · 1 comment
Open

Misnamed images on NHentai #346

ale5000-git opened this issue May 24, 2024 · 1 comment
Labels
bug Something isn't working website Issues related to websites

Comments

@ale5000-git
Copy link
Contributor

ale5000-git commented May 24, 2024

Jpg files are misnamed as png.
Example: nhentai.net/g/348878/

Is it possible for the app to read the start of the image to see if there is the JFIF marker and then rename to jpg?
It is possible to do it inside LUA but I think it would be better to detect it directly inside the app so it can work from all websites.

Example of detection code (the code is in Python but it isn't difficult to convert it): https://stackoverflow.com/a/51931778

@HDoujinDownloader HDoujinDownloader added bug Something isn't working website Issues related to websites labels May 25, 2024
@HDoujinDownloader
Copy link
Owner

HDoujinDownloader commented May 25, 2024

You're right, I was able to reproduce this. By default, it will attempt to fix the file extension based on the Content-Type header (which is usually correct), but even the header is incorrectly set to image/png here.

If you go to Tools > General settings, under "Advanced settings", there's a Downloads.ChangeFileExtensionToMatchSignature setting you can enable that does exactly what you're suggesting. It will detect a wide variety of image formats.

Another user reported a different website sending an incorrect Content-Type header recently, too. If this is a common occurance I may just have to enable that setting by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working website Issues related to websites
Projects
None yet
Development

No branches or pull requests

2 participants