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
{{ message }}
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.
We ran into a bug. We have a gltf binary buffer (.bin) file that gets detected as image/jpeg. This crashes our Model because we do some identify stuff based on the type for images.
Essentially the 3 method where the content type could come from are:
type_from_mime_magic this returns image/jpeg
type_from_file_command this returns application/octet-stream
calculated_type_matches this returns a application/octet-stream
we realise that type_from_file_contents is type_from_mime_magic || type_from_file_command so it will always return the wrong one.
and then, calculated_type_matches uses type_from_file_contents to select a value. That means even if type_from_file_command is present and correct, as long as type_from_mime_magicis present it will be wrong.
We ran into a bug. We have a gltf binary buffer (.bin) file that gets detected as image/jpeg. This crashes our Model because we do some identify stuff based on the type for images.
Essentially the 3 method where the content type could come from are:
type_from_mime_magic
this returnsimage/jpeg
type_from_file_command
this returnsapplication/octet-stream
calculated_type_matches
this returns aapplication/octet-stream
While looking at the detect method:
we realise that
type_from_file_contents
istype_from_mime_magic || type_from_file_command
so it will always return the wrong one.and then, calculated_type_matches uses
type_from_file_contents
to select a value. That means even iftype_from_file_command
is present and correct, as long astype_from_mime_magic
is present it will be wrong.to make it work, we change the method to this:
The text was updated successfully, but these errors were encountered: