detect method

detect

Detect the file format from file name, file must be readable so Aspose.3D can detect the file format through file header.

Returns

def detect(self, file_name):
    ...
ParameterTypeDescription
file_namestr

Example

from aspose.threed import FileFormat

fmt = FileFormat.detect("input.fbx")
print(f"Input file format: {fmt}")

detect

Detect the file format from data stream, file name is optional for guessing types that has no magic header.

Returns

def detect(self, stream, file_name):
    ...
ParameterTypeDescription
streamio.RawIOBase
file_namestr

Example

from aspose.threed import FileFormat
from io import BytesIO
import bytearray

bytes = bytearray(100)
fmt = FileFormat.detect(BytesIO(bytes), "input-file")
print(f"Input data format: {fmt}")

See Also