cpdf-source/cpdfpng.ml

22 lines
447 B
OCaml
Raw Normal View History

2022-12-23 15:29:47 +01:00
(* Read a non-interlaced, non-transparent 24 bit PNG for inclusion in a PDF file *)
type t =
{width : int;
height : int;
idat : Pdfio.bytes}
exception BadPNG of string
let read_png i =
(* File signature *)
(* IHDR *)
(* IDAT *)
(* IEND *)
{width = 0;
height = 0;
idat = Pdfio.bytes_of_string ""}
let _ =
read_png
(Pdfio.input_of_string
(Pdfutil.contents_of_file "/Users/john/Desktop/cpdfdraw/Untitled.png"))