Some glTF files exported by non-compliant tool chains may use mimeType: image/png but use JPEG images. While these files are invalid, it would be helpful to make an effort to fix this as the mimeType information is fairly redundant.
This change uses image header patterns defined in glTF specification to override mime type even if it's defined based on the image contents; this is done in readImage so that all consumers (that are mime type dependent!) get the correct result.
Some glTF files exported by non-compliant tool chains may use mimeType: image/png but use JPEG images. While these files are invalid, it would be helpful to make an effort to fix this as the mimeType information is fairly redundant.
This change uses image header patterns defined in glTF specification to override mime type even if it's defined based on the image contents; this is done in readImage so that all consumers (that are mime type dependent!) get the correct result.