Skip to content

Commit

Permalink
Revert "Revert Base64 to v2.3.0"
Browse files Browse the repository at this point in the history
This reverts commit ca9378b.
  • Loading branch information
jnavila committed May 30, 2020
1 parent 1c6587d commit 10eba06
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plotkicadsch.opam
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ depends: [
"sha"
"git" {>= "2.0.0"}
"git-unix"
"base64" {= "2.3.0"}
"base64" {>= "3.0.0"}
"patience_diff" { < "v0.12.0" }
"core_kernel"
"cmdliner"
Expand Down
2 changes: 1 addition & 1 deletion plotkicadsch/src/kicadDiff.ml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ let intersect_lists l1l l2l =
~f:(fun (name2, sha2) ->
List.exists
~f:(fun (name1, sha1) ->
List.equal ~equal:String.equal name1 name2 && not (String.equal sha2 sha1) )
List.equal String.equal name1 name2 && not (String.equal sha2 sha1) )
l1 )
l2
|> List.map ~f:fst
Expand Down
5 changes: 4 additions & 1 deletion plotkicadsch/src/svgPainter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ exception Base64Exception of string
let paint_image (Coord (x, y)) scale b ({c; _} as ctxt) =
let s = scale /. 0.3 in
let w, h = get_png_dims b in
let outstring = B64.encode (Buffer.contents b) in
match Base64.encode (Buffer.contents b) with
| Ok outstring ->
{ ctxt with
c=
image
Expand All @@ -187,6 +188,8 @@ let paint_image (Coord (x, y)) scale b ({c; _} as ctxt) =
; a_xlink_href @@ "data:image/png;base64," ^ outstring ]
[]
:: c }
| Error (`Msg err) ->
raise (Base64Exception err)

let get_context () = {d= (0, 0); c= []; colors= None}

Expand Down

0 comments on commit 10eba06

Please sign in to comment.