Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bimg thumbnailer #3522

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ require (
golang.org/x/mobile v0.0.0-20240520174638-fa72addaaa1b
golang.org/x/sync v0.10.0
golang.org/x/term v0.28.0
gopkg.in/h2non/bimg.v1 v1.1.9
gopkg.in/yaml.v2 v2.4.0
gotest.tools/v3 v3.5.1
maunium.net/go/mautrix v0.15.1
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/h2non/bimg.v1 v1.1.9 h1:wZIUbeOnwr37Ta4aofhIv8OI8v4ujpjXC9mXnAGpQjM=
gopkg.in/h2non/bimg.v1 v1.1.9/go.mod h1:PgsZL7dLwUbsGm1NYps320GxGgvQNTnecMCZqxV11So=
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0=
gopkg.in/macaroon.v2 v2.1.0 h1:HZcsjBCzq9t0eBPMKqTN/uSN6JOm78ZJ2INbqcBQOUI=
Expand Down
27 changes: 0 additions & 27 deletions mediaapi/README.md

This file was deleted.

3 changes: 2 additions & 1 deletion mediaapi/mediaapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
package mediaapi

import (
"github.com/sirupsen/logrus"

"github.com/element-hq/dendrite/internal/httputil"
"github.com/element-hq/dendrite/internal/sqlutil"
"github.com/element-hq/dendrite/mediaapi/routing"
Expand All @@ -15,7 +17,6 @@ import (
userapi "github.com/element-hq/dendrite/userapi/api"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/gomatrixserverlib/fclient"
"github.com/sirupsen/logrus"
)

// AddPublicRoutes sets up and registers HTTP handlers for the MediaAPI component.
Expand Down
3 changes: 2 additions & 1 deletion mediaapi/thumbnailer/thumbnailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import (
"path/filepath"
"sync"

log "github.com/sirupsen/logrus"

"github.com/element-hq/dendrite/mediaapi/storage"
"github.com/element-hq/dendrite/mediaapi/types"
"github.com/element-hq/dendrite/setup/config"
log "github.com/sirupsen/logrus"
)

type thumbnailFitness struct {
Expand Down
241 changes: 0 additions & 241 deletions mediaapi/thumbnailer/thumbnailer_bimg.go

This file was deleted.

11 changes: 4 additions & 7 deletions mediaapi/thumbnailer/thumbnailer_nfnt.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
// Please see LICENSE files in the repository root for full details.

//go:build !bimg
// +build !bimg

package thumbnailer

import (
Expand All @@ -20,18 +17,18 @@ import (

// Imported for png codec
_ "image/png"
"os"
"time"

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

"os"
"time"
"github.com/nfnt/resize"
log "github.com/sirupsen/logrus"

"github.com/element-hq/dendrite/mediaapi/storage"
"github.com/element-hq/dendrite/mediaapi/types"
"github.com/element-hq/dendrite/setup/config"
"github.com/nfnt/resize"
log "github.com/sirupsen/logrus"
)

// GenerateThumbnails generates the configured thumbnail sizes for the source file
Expand Down
Loading