Skip to content

Commit

Permalink
Merge pull request #2 from stakach/patch-1
Browse files Browse the repository at this point in the history
feat(png.cr): add support for passing in IO memory or files directly
  • Loading branch information
soya-daizu authored Sep 13, 2024
2 parents 3f4b501 + 02c20b8 commit c9fbf80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/goban/exporters/png.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Goban

# Generates a PNG image with the given target size and exports to the given path.
# Note that the size of the resulting image may not be equal to the target size specified.
def export(qr : AbstractQR, path : String, target_width : Int)
def export(qr : AbstractQR, path : String | IO, target_width : Int)
case qr
when RMQR
size = qr.size.width
Expand All @@ -32,7 +32,7 @@ module Goban
#
# `mod_size` refers to the number of pixels used for each module in the QR Code symbol,
# and `blank_mods` is the size of the white border around the symbol.
def export(qr : AbstractQR, path : String, mod_size : Int, blank_mods : Int)
def export(qr : AbstractQR, path : String | IO, mod_size : Int, blank_mods : Int)
blank_size = blank_mods * mod_size
case qr
when RMQR
Expand Down

0 comments on commit c9fbf80

Please sign in to comment.