Skip to content

Commit

Permalink
Write out files that do not trip.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuenzli committed Jan 24, 2023
1 parent f616399 commit 7ff7f01
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/trip.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ let trip file =
let* meta, pixels = Qoic.decode' bytes in
log " %a@?" Qoic.Meta.pp meta;
let bytes' = Qoic.encode meta pixels in
if bytes <> bytes' then Error ("\n" ^ diff file bytes bytes') else Ok ()
if bytes <> bytes' then
let outf = Fpath.to_string Fpath.(file -+ "-notrip.qoi") in
let* () = Bigfile.write outf bytes' in
Error ("\n" ^ diff file bytes bytes')
else Ok ()

let default_files () =
let default_dir = Fpath.v "images" in
Expand Down

0 comments on commit 7ff7f01

Please sign in to comment.