From b490e32d7d19ce373c819f7d726dd1c5540b2144 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 10 Mar 2021 15:43:10 +0100 Subject: [PATCH] add support for gifs to the thumbnails service --- changelog/unreleased/thumbnails-support-gifs.md | 5 +++++ .../expected-failures-webUI-on-OWNCLOUD-storage.md | 1 - thumbnails/pkg/thumbnail/imgsource/webdav.go | 3 +++ webdav/pkg/service/v0/service.go | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/thumbnails-support-gifs.md diff --git a/changelog/unreleased/thumbnails-support-gifs.md b/changelog/unreleased/thumbnails-support-gifs.md new file mode 100644 index 000000000..be424d122 --- /dev/null +++ b/changelog/unreleased/thumbnails-support-gifs.md @@ -0,0 +1,5 @@ +Enhancement: Generate thumbnails for .gif files + +Added support for gifs to the thumbnails service. + +https://github.com/owncloud/ocis/pull/1791 diff --git a/tests/acceptance/expected-failures-webUI-on-OWNCLOUD-storage.md b/tests/acceptance/expected-failures-webUI-on-OWNCLOUD-storage.md index 8dd5efdb6..c942aa620 100644 --- a/tests/acceptance/expected-failures-webUI-on-OWNCLOUD-storage.md +++ b/tests/acceptance/expected-failures-webUI-on-OWNCLOUD-storage.md @@ -19,7 +19,6 @@ Other free text and markdown formatting can be used elsewhere in the document if ### [Media Viewer preview not visible for files with .jpeg, .ogg, .webm and .gif formats](https://github.com/owncloud/ocis/issues/1490) - [webUIPreview/imageMediaViewer.feature:136](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPreview/imageMediaViewer.feature#L136) -- [webUIPreview/imageMediaViewer.feature:145](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPreview/imageMediaViewer.feature#L145) - [webUIPreview/imageMediaViewer.feature:154](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPreview/imageMediaViewer.feature#L154) ### [Media viewer previews are not visible in public share](https://github.com/owncloud/ocis/issues/1370) diff --git a/thumbnails/pkg/thumbnail/imgsource/webdav.go b/thumbnails/pkg/thumbnail/imgsource/webdav.go index fbaaf0197..99d24c072 100644 --- a/thumbnails/pkg/thumbnail/imgsource/webdav.go +++ b/thumbnails/pkg/thumbnail/imgsource/webdav.go @@ -5,6 +5,9 @@ import ( "crypto/tls" "fmt" "image" + _ "image/gif" // Import the gif package so that image.Decode can understand gifs + _ "image/jpeg" // Import the jpeg package so that image.Decode can understand jpegs + _ "image/png" // Import the png package so that image.Decode can understand pngs "net/http" "net/url" "path" diff --git a/webdav/pkg/service/v0/service.go b/webdav/pkg/service/v0/service.go index 86d45ccac..854c777c1 100644 --- a/webdav/pkg/service/v0/service.go +++ b/webdav/pkg/service/v0/service.go @@ -95,7 +95,7 @@ func extensionToFiletype(ext string) thumbnails.GetRequest_FileType { case "JPG", "PNG": val := thumbnails.GetRequest_FileType_value[ext] return thumbnails.GetRequest_FileType(val) - case "JPEG": + case "JPEG", "GIF": val := thumbnails.GetRequest_FileType_value["JPG"] return thumbnails.GetRequest_FileType(val) default: