You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The mimeType is resolved by us based on the file extension so this is essentially our fault.
I thought I'd file this issue anyway so that other people hitting a similar problem can find it.
Is there a better way to create a BufferedImage from an InputStream, i.e. one that would resolve the actual mime type instead of using an inferred one to resolve the proper ImageReader?
The text was updated successfully, but these errors were encountered:
This way, each plugin provider (ImageReaderSpi instance) will be passed the actual payload (input in the example above), to see if this is a format it understands, and if so, it can create an ImageReader instance to read it.
I prefer this way, because file extensions can be wrong and there are often multiple extensions for each format. MIME types from browsers can also not be fully trusted. Inspecting the actual payload is just safer and more reliable (although there can be false positives here as well).
This is a followup to my comment in issue #22.
The exception is thrown with the following stack trace:
The code causing the issue looks like this:
The
mimeType
is resolved by us based on the file extension so this is essentially our fault.I thought I'd file this issue anyway so that other people hitting a similar problem can find it.
Is there a better way to create a
BufferedImage
from anInputStream
, i.e. one that would resolve the actual mime type instead of using an inferred one to resolve the properImageReader
?The text was updated successfully, but these errors were encountered: