Skip to content

Commit ad22d95

Browse files
authored
Remove bimg thumbnailer (#3522)
As it is most likely not used anyway. (It's not the default)
1 parent 57bbba3 commit ad22d95

File tree

7 files changed

+8
-280
lines changed

7 files changed

+8
-280
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ require (
5151
golang.org/x/mobile v0.0.0-20240520174638-fa72addaaa1b
5252
golang.org/x/sync v0.10.0
5353
golang.org/x/term v0.28.0
54-
gopkg.in/h2non/bimg.v1 v1.1.9
5554
gopkg.in/yaml.v2 v2.4.0
5655
gotest.tools/v3 v3.5.1
5756
maunium.net/go/mautrix v0.15.1

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
488488
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
489489
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
490490
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
491-
gopkg.in/h2non/bimg.v1 v1.1.9 h1:wZIUbeOnwr37Ta4aofhIv8OI8v4ujpjXC9mXnAGpQjM=
492-
gopkg.in/h2non/bimg.v1 v1.1.9/go.mod h1:PgsZL7dLwUbsGm1NYps320GxGgvQNTnecMCZqxV11So=
493491
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
494492
gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0=
495493
gopkg.in/macaroon.v2 v2.1.0 h1:HZcsjBCzq9t0eBPMKqTN/uSN6JOm78ZJ2INbqcBQOUI=

mediaapi/README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

mediaapi/mediaapi.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
package mediaapi
88

99
import (
10+
"github.com/sirupsen/logrus"
11+
1012
"github.com/element-hq/dendrite/internal/httputil"
1113
"github.com/element-hq/dendrite/internal/sqlutil"
1214
"github.com/element-hq/dendrite/mediaapi/routing"
@@ -15,7 +17,6 @@ import (
1517
userapi "github.com/element-hq/dendrite/userapi/api"
1618
"github.com/matrix-org/gomatrixserverlib"
1719
"github.com/matrix-org/gomatrixserverlib/fclient"
18-
"github.com/sirupsen/logrus"
1920
)
2021

2122
// AddPublicRoutes sets up and registers HTTP handlers for the MediaAPI component.

mediaapi/thumbnailer/thumbnailer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ import (
1414
"path/filepath"
1515
"sync"
1616

17+
log "github.com/sirupsen/logrus"
18+
1719
"github.com/element-hq/dendrite/mediaapi/storage"
1820
"github.com/element-hq/dendrite/mediaapi/types"
1921
"github.com/element-hq/dendrite/setup/config"
20-
log "github.com/sirupsen/logrus"
2122
)
2223

2324
type thumbnailFitness struct {

mediaapi/thumbnailer/thumbnailer_bimg.go

Lines changed: 0 additions & 241 deletions
This file was deleted.

mediaapi/thumbnailer/thumbnailer_nfnt.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
55
// Please see LICENSE files in the repository root for full details.
66

7-
//go:build !bimg
8-
// +build !bimg
9-
107
package thumbnailer
118

129
import (
@@ -20,18 +17,18 @@ import (
2017

2118
// Imported for png codec
2219
_ "image/png"
20+
"os"
21+
"time"
2322

2423
// Imported for webp codec
2524
_ "golang.org/x/image/webp"
2625

27-
"os"
28-
"time"
26+
"github.com/nfnt/resize"
27+
log "github.com/sirupsen/logrus"
2928

3029
"github.com/element-hq/dendrite/mediaapi/storage"
3130
"github.com/element-hq/dendrite/mediaapi/types"
3231
"github.com/element-hq/dendrite/setup/config"
33-
"github.com/nfnt/resize"
34-
log "github.com/sirupsen/logrus"
3532
)
3633

3734
// GenerateThumbnails generates the configured thumbnail sizes for the source file

0 commit comments

Comments
 (0)