Skip to content
Draft
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
14 changes: 14 additions & 0 deletions .scaffold/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
entgo.io/ent v0.14.5 h1:Rj2WOYJtCkWyFo6a+5wB3EfBRP0rnx1fMk6gGA0UUe4=
entgo.io/ent v0.14.5/go.mod h1:zTzLmWtPvGpmSwtkaayM2cm5m819NdM7z7tYPq3vN0U=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/sysadminsmedia/homebox/backend v0.0.0-20251011125515-397a1c6f3e28 h1:/+aasMDlraSwlQBe/wb+P0Ir0cfwsOkSMqAWEprFAug=
github.com/sysadminsmedia/homebox/backend v0.0.0-20251011125515-397a1c6f3e28/go.mod h1:eO7Zyond1Dw9roeYTVd3W88xYeWSOiYqpF6r2qOKVlA=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
18 changes: 13 additions & 5 deletions backend/internal/data/repo/repo_item_attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,17 +629,17 @@ func (r *AttachmentRepo) CreateThumbnail(ctx context.Context, groupId, attachmen
log.Debug().Msg("creating thumbnail for heic file")
img, err := heic.Decode(bytes.NewReader(contentBytes))
if err != nil {
log.Err(err).Msg("failed to decode avif image")
log.Err(err).Msg("failed to decode heic image")
err := tx.Rollback()
if err != nil {
return err
}
return err
}
log.Debug().Msg("reading original file orientation")
imageMeta, err := imagemeta.Decode(bytes.NewReader(contentBytes))
imageMeta, err := imagemeta.DecodeHeif(bytes.NewReader(contentBytes))
if err != nil {
log.Err(err).Msg("failed to decode original file content")
log.Err(err).Msg("failed to decode heic file metadata")
err := tx.Rollback()
if err != nil {
return err
Expand All @@ -660,14 +660,22 @@ func (r *AttachmentRepo) CreateThumbnail(ctx context.Context, groupId, attachmen
log.Debug().Msg("creating thumbnail for jpegxl file")
img, err := jpegxl.Decode(bytes.NewReader(contentBytes))
if err != nil {
log.Err(err).Msg("failed to decode avif image")
log.Err(err).Msg("failed to decode jpegxl image")
err := tx.Rollback()
if err != nil {
return err
}
return err
}
thumbnailPath, err := r.processThumbnailFromImage(ctx, groupId, img, title, uint16(1))
log.Debug().Msg("reading original file orientation")
orientation := uint16(1) // Default orientation
imageMeta, err := imagemeta.Decode(bytes.NewReader(contentBytes))
if err != nil {
log.Debug().Msg("unable to decode jxl metadata, using default orientation")
} else {
orientation = uint16(imageMeta.Orientation)
}
thumbnailPath, err := r.processThumbnailFromImage(ctx, groupId, img, title, orientation)
if err != nil {
err := tx.Rollback()
if err != nil {
Expand Down
Loading