detect method
Contents
[
Hide
]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):
...
Parameter | Type | Description |
---|---|---|
file_name | str |
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):
...
Parameter | Type | Description |
---|---|---|
stream | io.RawIOBase | |
file_name | str |
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
- module
aspose.threed.formats
- class
PdfFormat