term.gfx.proto.png_dimensions

term.gfx.proto

png_dimensions(path) -> width, height

Read pixel dimensions from a PNG file header

Reads the IHDR chunk from a PNG file to extract the image width and height in pixels. Returns two numbers on success, or nil if the file cannot be read or is not a valid PNG.