{"success":true,"data":{"ext":"tga","name":"TGA","description":"TGA, or Truevision Graphics Adapter/Targa, is a raster image file format originally created by Truevision Inc. and later supported by image software and graphics libraries. It is commonly used for textures, screenshots, and other bitmap images in design, games, and digital art workflows. The format is largely legacy, but it remains safe to open; as with any image file, malformed files can trigger parser bugs in unpatched applications.","mime":["image/x-tga"],"risk_level":"Safe","signatures":[{"hex":"01 01 00 00","offset":1,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"00 02 00 00","offset":1,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"00 03 00 00","offset":1,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]}],"related":["avif","bmp","cr2","cr3","dib","exr"],"usage":{"python":"def is_tga(file_path: str) -> bool:\n    \"\"\"Check if file is a valid TGA by magic bytes at offset 1.\"\"\"\n    signature = bytes([0x01, 0x01, 0x00, 0x00])\n    with open(file_path, \"rb\") as f:\n        f.seek(1)\n        return f.read(4) == signature","node":"function isTGA(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x01, 0x01, 0x00, 0x00]);\n  if (buffer.length < 5) return false;\n  return buffer.subarray(1, 5).equals(signature);\n}","go":"func IsTGA(data []byte) bool {\n    signature := []byte{0x01, 0x01, 0x00, 0x00}\n    if len(data) < 5 {\n        return false\n    }\n    return bytes.Equal(data[1:5], signature)\n}"},"category":"Images"}}