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 MIME detection is inaccurate #7

Closed
Mosesofmason opened this issue Nov 18, 2023 · 3 comments
Closed

The MIME detection is inaccurate #7

Mosesofmason opened this issue Nov 18, 2023 · 3 comments

Comments

@Mosesofmason
Copy link

In my case, the MIME detection for *.jpg images is incorrect for some reason. Certain images are being identified as application/octet-stream instead of image/jpeg, and I have to manually change them one by one.

I would greatly appreciate it if there could be an enhancement in the accuracy of the MIME detection. Additionally, the inclusion of a batch change option would be highly beneficial for a smoother process.

jSite version 0.14
JDK version: 21.0.1

@Bombe
Copy link
Owner

Bombe commented Nov 18, 2023

I just took a look at how I’m selecting default MIME types for files, and the only thing that is being used to select the default MIME type is the file’s extension. In order to be recognized as “image/jpeg,” the file needs to end in “.jpeg”, “.jpg”, or “.jpe”. Also, bear in mind that the extension is case-sensitive, so “IMAGE.JPG” will not be recognized as a JPEG image.

Does that help?

@Mosesofmason
Copy link
Author

Yes, upon rechecking, the file extensions of the problematic files indeed have uppercase letters.

@Bombe
Copy link
Owner

Bombe commented Nov 18, 2023

I’m a bit on the fence whether I should change anything here but as I can find arguments for both “do it” and “don’t do it” I err on the side of laziness and will be closing this issue. 😄

@Bombe Bombe closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2023
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