mdx-m3-viewer
Version:
A browser WebGL model viewer. Mainly focused on models of the games Warcraft 3 and Starcraft 2.
17 lines (13 loc) • 366 B
text/typescript
import { isStringInBytes } from '../../common/searches';
/**
* Detects if the given object is a TGA source.
*/
export default function isTga(object: any) {
if (object instanceof ArrayBuffer) {
let buffer = new Uint8Array(object);
if (isStringInBytes(buffer, 'TRUEVISION-XFILE.\0', buffer.length - 18)) {
return true;
}
}
return false;
}