diff --git a/convert.go b/convert.go index 7c749b2..28a03dd 100644 --- a/convert.go +++ b/convert.go @@ -5,8 +5,6 @@ import ( "io" "os" - _ "github.com/sunshineplan/tiff" - "github.com/disintegration/imaging" ) diff --git a/converter/go.mod b/converter/go.mod index e47c99f..d763bf0 100644 --- a/converter/go.mod +++ b/converter/go.mod @@ -1,11 +1,10 @@ module converter -go 1.20 +go 1.21 require ( - github.com/sunshineplan/imgconv v1.1.4 - github.com/sunshineplan/tiff v0.0.0-20220128141034-29b9d69bd906 - github.com/sunshineplan/utils v0.1.45 + github.com/sunshineplan/imgconv v0.0.0-00010101000000-000000000000 + github.com/sunshineplan/utils v0.1.46 ) require ( @@ -17,8 +16,8 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/sunshineplan/pdf v1.0.5 // indirect - golang.org/x/image v0.9.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/image v0.11.0 // indirect + golang.org/x/text v0.12.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/converter/go.sum b/converter/go.sum index 878ed0c..9a46ea5 100644 --- a/converter/go.sum +++ b/converter/go.sum @@ -15,16 +15,14 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/sunshineplan/pdf v1.0.5 h1:hPdpaqMZEHY99kDO5fBfmHrojBpmxbVsNreVALcFWEU= github.com/sunshineplan/pdf v1.0.5/go.mod h1:Ljdz22+kL80CUXCIGdRUwA7PsfB7gj7ni4U71k5ZHp4= -github.com/sunshineplan/tiff v0.0.0-20220128141034-29b9d69bd906 h1:+yYRCj+PGQNnnen4+/Q7eKD2J87RJs+O39bjtHhPauk= -github.com/sunshineplan/tiff v0.0.0-20220128141034-29b9d69bd906/go.mod h1:O+Ar7ouRbdfxLgoZLFz447/dvdM1NVKk1VpOQaijvAU= -github.com/sunshineplan/utils v0.1.45 h1:HGRgIhIttxkDsOP6Z4+UH2D7nBUG5gqFdKGQ6WvDmTs= -github.com/sunshineplan/utils v0.1.45/go.mod h1:Wx+eubdt52Vl0l7U6gGjtP6VGrA5jqLeqWNDckGXL8I= +github.com/sunshineplan/utils v0.1.46 h1:m43TSqYY0K+n5rY93+7Hr1UCWvtWQYve31nB7G5Us9g= +github.com/sunshineplan/utils v0.1.46/go.mod h1:7zhDUGgKo2FMFzs7j6IL7B/lh3BRuE7rb7R7IgGOAfc= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.9.0 h1:QrzfX26snvCM20hIhBwuHI/ThTg18b/+kcKdXHvnR+g= -golang.org/x/image v0.9.0/go.mod h1:jtrku+n79PfroUbvDdeUWMAI+heR786BofxrbiSF+J0= +golang.org/x/image v0.11.0 h1:ds2RoQvBvYTiJkwpSFDwCcDFNX7DqjL2WsUgTNk0Ooo= +golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -47,8 +45,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= diff --git a/converter/main.go b/converter/main.go index 20088ea..d162b1b 100644 --- a/converter/main.go +++ b/converter/main.go @@ -16,7 +16,6 @@ import ( "time" "github.com/sunshineplan/imgconv" - _ "github.com/sunshineplan/tiff" "github.com/sunshineplan/utils/flags" "github.com/sunshineplan/utils/progressbar" "github.com/sunshineplan/utils/workers" @@ -62,7 +61,7 @@ func usage() { --quality set jpeg or pdf quality (range 1-100, default: 75) --compression - set tiff compression type (none, lzw, jpeg, deflate, default: lzw) + set tiff compression type (none, lzw, deflate, default: lzw) --auto-orientation auto orientation (default: false) --watermark @@ -123,8 +122,6 @@ func main() { ct = imgconv.TIFFUncompressed case "lzw": ct = imgconv.TIFFLZW - case "jpeg": - ct = imgconv.TIFFJPEG case "deflate": ct = imgconv.TIFFDeflate default: diff --git a/format.go b/format.go index 10f1beb..17c6f50 100644 --- a/format.go +++ b/format.go @@ -12,8 +12,8 @@ import ( "github.com/disintegration/imaging" "github.com/sunshineplan/pdf" - "github.com/sunshineplan/tiff" // decode tiff format, not check IFD tags order "golang.org/x/image/bmp" + "golang.org/x/image/tiff" _ "golang.org/x/image/webp" // decode webp format ) @@ -68,7 +68,6 @@ const ( TIFFLZW TIFFCCITTGroup3 TIFFCCITTGroup4 - TIFFJPEG ) func (c TIFFCompression) value() tiff.CompressionType { @@ -81,8 +80,6 @@ func (c TIFFCompression) value() tiff.CompressionType { return tiff.CCITTGroup3 case TIFFCCITTGroup4: return tiff.CCITTGroup4 - case TIFFJPEG: - return tiff.JPEG } return tiff.Uncompressed } diff --git a/format_test.go b/format_test.go index dec557d..aa36394 100644 --- a/format_test.go +++ b/format_test.go @@ -27,7 +27,6 @@ func TestEncode(t *testing.T) { {Format: PNG, EncodeOption: []EncodeOption{PNGCompressionLevel(png.DefaultCompression)}}, {Format: GIF, EncodeOption: []EncodeOption{GIFNumColors(256), GIFDrawer(draw.FloydSteinberg), GIFQuantizer(nil)}}, {Format: TIFF, EncodeOption: []EncodeOption{TIFFCompressionType(TIFFLZW)}}, - {Format: TIFF, EncodeOption: []EncodeOption{TIFFCompressionType(TIFFJPEG)}}, {Format: BMP}, {Format: PDF, EncodeOption: []EncodeOption{Quality(75)}}, } diff --git a/go.mod b/go.mod index 592ad96..8f204f9 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,10 @@ module github.com/sunshineplan/imgconv -go 1.20 +go 1.21 require ( github.com/disintegration/imaging v1.6.2 github.com/sunshineplan/pdf v1.0.5 - github.com/sunshineplan/tiff v0.0.0-20220128141034-29b9d69bd906 golang.org/x/image v0.11.0 ) diff --git a/go.sum b/go.sum index c657ac0..69adee1 100644 --- a/go.sum +++ b/go.sum @@ -15,8 +15,6 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/sunshineplan/pdf v1.0.5 h1:hPdpaqMZEHY99kDO5fBfmHrojBpmxbVsNreVALcFWEU= github.com/sunshineplan/pdf v1.0.5/go.mod h1:Ljdz22+kL80CUXCIGdRUwA7PsfB7gj7ni4U71k5ZHp4= -github.com/sunshineplan/tiff v0.0.0-20220128141034-29b9d69bd906 h1:+yYRCj+PGQNnnen4+/Q7eKD2J87RJs+O39bjtHhPauk= -github.com/sunshineplan/tiff v0.0.0-20220128141034-29b9d69bd906/go.mod h1:O+Ar7ouRbdfxLgoZLFz447/dvdM1NVKk1VpOQaijvAU= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=