On Tue, 23 Nov 2021 15:33:49 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
> This seems like an odd behavior to me, but if this is common practice among > browsers, then it seems OK for us to do the same. In this case, it should be > documented in the class docs of `Image`. I've tested this with Chrome and Edge, and these browsers go even further. If the image format has a detectable signature, the image will be displayed regardless of the specified MIME type (even if it is not an `image` type). The MIME type only matters for image formats without signature, like SVG. In this case, the image will not be displayed if the MIME type is incorrect. I think that a compromise works best for JavaFX. We probably don't want to allow plainly incorrect MIME types, but in cases where we know what the developer should have specified, a warning seems like a good nudge in the right direction. ------------- PR: https://git.openjdk.java.net/jfx/pull/676