gltf-rs / gltf

A crate for loading glTF 2.0
Apache License 2.0
534 stars 124 forks source link

Expose Scheme API publicly or allow access to encoded images #390

Open ShaddyDC opened 1 year ago

ShaddyDC commented 1 year ago

I'm writing a tool to convert glTF files to other file formats. When I ran into the issue of large images being unsupported (#388 ), I noticed that in most cases I can just copy the encoded image data as is without needing to do any decoding at all.

Currently, if you want to manually handle the encoded image data, you have to basically reimplement the logic for reading the schema and loading the encoded data. It would be convenient if I could reuse the existing logic from the crate and just add the logic for dealing with the raw data myself.

Even more convenient would be a function to directly load and return the encoded_data and encoded_format of an image, so I don't have to duplicate the logic for loading base64 etc, but I'm not sure how common that use case is.