Which file format the bytes start like. It looks at the signature only, not the rest of the file.
png := encode_png(make_image(1, 1, .RGB8));
defer free(png.data);
assert(detect_image_format(png) == .PNG);
assert(detect_image_format(cast([] u8) "hello") == .UNKNOWN);detect_image_format :: (data: [] u8) -> Image_File_Format
Parameters
- data: [] u8