Model loading · function
identifyTexture
An image wrapped for embedding, identified by its own header, or a white texel where the header
says nothing this format knows, with the reason in warnings.
Explained in Importing models.
function identifyTexture(name: string, bytes: Uint8Array, warnings: string[]): DrftTextureSourceimport { identifyTexture } from '@driftengine/assets';Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | |
bytes | Uint8Array | |
warnings | string[] |
In depth
The bytes are identified rather than trusted: glTF's mimeType is optional and wrong often enough
that the image's own header is the only reliable answer.