A tool for archiving & converting scans of postcards, and information about them.

fix: support macOS TIFF images

Swaps to a newer tiff library, which supports macOS scanner TIFF images 🎉

+26 -8
+1 -1
README.md
··· 23 23 24 24 - Use a scanner (for accurate resolution info) 25 25 - Use a black background (as black as possible, to minimise shadows) 26 - - Save your scan as a PNG (For quality, and because Go doesn't support macOS' TIFF encoding) 26 + - Save your scan as a TIFF or PNG (for high, lossless quality) 27 27 28 28 > [!TIP] 29 29 > There is an experimental web-based postcard creator at [create.dotpostcard.org](https://create.dotpostcard.org), which you may find easier.
+1 -1
formats/component/decode.go
··· 10 10 "io" 11 11 12 12 "git.sr.ht/~sbinet/gg" 13 + _ "github.com/hhrutter/tiff" 13 14 "github.com/jphastings/dotpostcard/formats" 14 15 "github.com/jphastings/dotpostcard/internal/resolution" 15 16 "github.com/jphastings/dotpostcard/types" 16 - _ "github.com/sunshineplan/tiff" 17 17 "golang.org/x/image/draw" 18 18 ) 19 19
+20 -4
go.mod
··· 1 1 module github.com/jphastings/dotpostcard 2 2 3 - go 1.23.0 4 - 5 - toolchain go1.23.4 3 + go 1.24.3 6 4 7 5 require ( 8 6 git.sr.ht/~jackmordaunt/go-libwebp v1.8.0 ··· 15 13 github.com/dsoprea/go-tiff-image-structure v0.0.0-20221003165014-8ecc4f52edca 16 14 github.com/ernyoke/imger v1.0.0 17 15 github.com/gen2brain/jpegli v0.3.4 16 + github.com/hhrutter/tiff v1.0.2 18 17 github.com/nlepage/go-wasm-http-server/v2 v2.1.0 19 18 github.com/spf13/cobra v1.9.1 20 19 github.com/stretchr/testify v1.9.0 21 - github.com/sunshineplan/tiff v0.0.0-20220128141034-29b9d69bd906 22 20 github.com/trimmer-io/go-xmp v1.0.0 23 21 github.com/valyala/quicktemplate v1.8.0 24 22 golang.org/x/image v0.29.0 ··· 28 26 replace git.sr.ht/~jackmordaunt/go-libwebp => ./internal/go-libwebp 29 27 30 28 require ( 29 + git.sr.ht/~sbinet/cmpimg v0.1.0 // indirect 31 30 github.com/alecthomas/chroma/v2 v2.19.0 // indirect 32 31 github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect 33 32 github.com/aymerick/douceur v0.2.0 // indirect ··· 52 51 github.com/go-xmlfmt/xmlfmt v1.1.3 // indirect 53 52 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect 54 53 github.com/golang/geo v0.0.0-20250707181242-c5087ca84cf4 // indirect 54 + github.com/google/go-cmp v0.7.0 // indirect 55 55 github.com/google/uuid v1.6.0 // indirect 56 56 github.com/gorilla/css v1.0.1 // indirect 57 57 github.com/hack-pad/safejs v0.1.1 // indirect 58 58 github.com/hhrutter/lzw v1.0.0 // indirect 59 59 github.com/inconshreveable/mousetrap v1.1.0 // indirect 60 60 github.com/kr/pretty v0.3.1 // indirect 61 + github.com/kr/text v0.2.0 // indirect 61 62 github.com/lucasb-eyer/go-colorful v1.2.0 // indirect 62 63 github.com/mattn/go-isatty v0.0.20 // indirect 63 64 github.com/mattn/go-runewidth v0.0.16 // indirect ··· 66 67 github.com/muesli/termenv v0.16.0 // indirect 67 68 github.com/ncruces/go-strftime v0.1.9 // indirect 68 69 github.com/nlepage/go-js-promise v1.1.0 // indirect 70 + github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect 69 71 github.com/pmezard/go-difflib v1.0.0 // indirect 70 72 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect 71 73 github.com/rivo/uniseg v0.4.7 // indirect 74 + github.com/rogpeppe/go-internal v1.9.0 // indirect 72 75 github.com/spf13/pflag v1.0.6 // indirect 73 76 github.com/tetratelabs/wazero v1.9.0 // indirect 74 77 github.com/valyala/bytebufferpool v1.0.0 // indirect ··· 76 79 github.com/yuin/goldmark v1.7.12 // indirect 77 80 github.com/yuin/goldmark-emoji v1.0.6 // indirect 78 81 golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect 82 + golang.org/x/mod v0.25.0 // indirect 79 83 golang.org/x/net v0.42.0 // indirect 84 + golang.org/x/sync v0.16.0 // indirect 80 85 golang.org/x/sys v0.34.0 // indirect 81 86 golang.org/x/term v0.33.0 // indirect 82 87 golang.org/x/text v0.27.0 // indirect 88 + golang.org/x/tools v0.34.0 // indirect 83 89 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect 84 90 gopkg.in/yaml.v2 v2.4.0 // indirect 91 + modernc.org/cc/v4 v4.26.2 // indirect 92 + modernc.org/ccgo/v4 v4.28.0 // indirect 93 + modernc.org/fileutil v1.3.8 // indirect 94 + modernc.org/gc/v2 v2.6.5 // indirect 95 + modernc.org/goabi0 v0.2.0 // indirect 85 96 modernc.org/libc v1.66.3 // indirect 86 97 modernc.org/mathutil v1.7.1 // indirect 87 98 modernc.org/memory v1.11.0 // indirect 99 + modernc.org/opt v0.1.4 // indirect 100 + modernc.org/sortutil v1.2.1 // indirect 101 + modernc.org/strutil v1.2.1 // indirect 102 + modernc.org/token v1.1.0 // indirect 103 + rsc.io/pdf v0.1.1 // indirect 88 104 )
+4 -2
go.sum
··· 111 111 github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= 112 112 github.com/hhrutter/lzw v1.0.0 h1:laL89Llp86W3rRs83LvKbwYRx6INE8gDn0XNb1oXtm0= 113 113 github.com/hhrutter/lzw v1.0.0/go.mod h1:2HC6DJSn/n6iAZfgM3Pg+cP1KxeWc3ezG8bBqW5+WEo= 114 + github.com/hhrutter/tiff v1.0.2 h1:7H3FQQpKu/i5WaSChoD1nnJbGx4MxU5TlNqqpxw55z8= 115 + github.com/hhrutter/tiff v1.0.2/go.mod h1:pcOeuK5loFUE7Y/WnzGw20YxUdnqjY1P0Jlcieb/cCw= 114 116 github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= 115 117 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 116 118 github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= ··· 141 143 github.com/nlepage/go-js-promise v1.1.0/go.mod h1:bdOP0wObXu34euibyK39K1hoBCtlgTKXGc56AGflaRo= 142 144 github.com/nlepage/go-wasm-http-server/v2 v2.1.0 h1:KAkpUxR6LzTaBPj0DikhTUJwlxdGGI8WHa0pX8P8yvI= 143 145 github.com/nlepage/go-wasm-http-server/v2 v2.1.0/go.mod h1:r8j7cEOeUqNp+c+C52sNuWaFTvvT/cNqIwBuEtA36HA= 146 + github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= 147 + github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= 144 148 github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= 145 149 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 146 150 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= ··· 159 163 github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 160 164 github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= 161 165 github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 162 - github.com/sunshineplan/tiff v0.0.0-20220128141034-29b9d69bd906 h1:+yYRCj+PGQNnnen4+/Q7eKD2J87RJs+O39bjtHhPauk= 163 - github.com/sunshineplan/tiff v0.0.0-20220128141034-29b9d69bd906/go.mod h1:O+Ar7ouRbdfxLgoZLFz447/dvdM1NVKk1VpOQaijvAU= 164 166 github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I= 165 167 github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM= 166 168 github.com/trimmer-io/go-xmp v1.0.0 h1:zY8bolSga5kOjBAaHS6hrdxLgEoYuT875xTy0QDwZWs=