Merge pull request #1791 from owncloud/thumbnails-support-gifs

add support for gifs to the thumbnails service
This commit is contained in:
David Christofas
2021-03-11 10:18:39 +01:00
committed by GitHub
4 changed files with 9 additions and 2 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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"

View File

@@ -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: