From 0d1d9f2f25454b941d8057dcbaebdd3ad7d34dff Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 22 Sep 2022 01:30:49 +0200 Subject: [PATCH 1/2] add thumbnail support for tiff and bmp files --- changelog/unreleased/thumbnails-tiff-bmp.md | 5 +++++ services/thumbnails/pkg/thumbnail/thumbnail.go | 13 ++++++++----- services/web/pkg/config/defaults/defaultconfig.go | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 changelog/unreleased/thumbnails-tiff-bmp.md diff --git a/changelog/unreleased/thumbnails-tiff-bmp.md b/changelog/unreleased/thumbnails-tiff-bmp.md new file mode 100644 index 000000000..309dc093c --- /dev/null +++ b/changelog/unreleased/thumbnails-tiff-bmp.md @@ -0,0 +1,5 @@ +Enhancement: Add thumbnails support for tiff and bmp files + +Support generating thumbnails for tiff and bmp files in the thumbnails service. + +https://github.com/owncloud/ocis/pull/4634 diff --git a/services/thumbnails/pkg/thumbnail/thumbnail.go b/services/thumbnails/pkg/thumbnail/thumbnail.go index c1efbe22e..31325ff3d 100644 --- a/services/thumbnails/pkg/thumbnail/thumbnail.go +++ b/services/thumbnails/pkg/thumbnail/thumbnail.go @@ -13,11 +13,14 @@ import ( var ( // SupportedMimeTypes contains a all mimetypes which are supported by the thumbnailer. SupportedMimeTypes = map[string]struct{}{ - "image/png": {}, - "image/jpg": {}, - "image/jpeg": {}, - "image/gif": {}, - "text/plain": {}, + "image/png": {}, + "image/jpg": {}, + "image/jpeg": {}, + "image/gif": {}, + "image/bmp": {}, + "image/x-ms-bmp": {}, + "image/tiff": {}, + "text/plain": {}, } ) diff --git a/services/web/pkg/config/defaults/defaultconfig.go b/services/web/pkg/config/defaults/defaultconfig.go index 0e913c4c9..a0c326d95 100644 --- a/services/web/pkg/config/defaults/defaultconfig.go +++ b/services/web/pkg/config/defaults/defaultconfig.go @@ -49,7 +49,7 @@ func DefaultConfig() *config.Config { }, Apps: []string{"files", "search", "preview", "text-editor", "pdf-viewer", "external", "user-management"}, Options: map[string]interface{}{ - "previewFileMimeTypes": []string{"image/gif", "image/png", "image/jpeg", "text/plain"}, + "previewFileMimeTypes": []string{"image/gif", "image/png", "image/jpeg", "text/plain", "image/tiff", "image/bmp", "image/x-ms-bmp"}, }, }, }, From 3914f644e6699706d77800aceec77dc36383a944 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 22 Sep 2022 11:36:54 +0200 Subject: [PATCH 2/2] add tiff and bmp to the preview app config --- services/web/pkg/config/defaults/defaultconfig.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/services/web/pkg/config/defaults/defaultconfig.go b/services/web/pkg/config/defaults/defaultconfig.go index a0c326d95..cf08feeb1 100644 --- a/services/web/pkg/config/defaults/defaultconfig.go +++ b/services/web/pkg/config/defaults/defaultconfig.go @@ -47,7 +47,20 @@ func DefaultConfig() *config.Config { ResponseType: "code", Scope: "openid profile email", }, - Apps: []string{"files", "search", "preview", "text-editor", "pdf-viewer", "external", "user-management"}, + Apps: []string{"files", "search", "text-editor", "pdf-viewer", "external", "user-management"}, + ExternalApps: []config.ExternalApp{ + { + ID: "preview", + Path: "web-app-preview", + Config: map[string]interface{}{ + "mimeTypes": []string{ + "image/tiff", + "image/bmp", + "image/x-ms-bmp", + }, + }, + }, + }, Options: map[string]interface{}{ "previewFileMimeTypes": []string{"image/gif", "image/png", "image/jpeg", "text/plain", "image/tiff", "image/bmp", "image/x-ms-bmp"}, },