From e875cafa24704a428e324480d5c531cb60bde973 Mon Sep 17 00:00:00 2001 From: wuzh Date: Tue, 27 Jul 2021 00:51:03 +0800 Subject: [PATCH] support bmp image. use magick to process --- controllers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controllers.go b/controllers.go index 7efd917a..29c845ec 100644 --- a/controllers.go +++ b/controllers.go @@ -92,6 +92,11 @@ func imageHandler(w http.ResponseWriter, r *http.Request, buf []byte, operation } } + // Use magick to process bmp image + if mimeType == "image/bmp" { + mimeType = "image/magick" + } + // Infer text/plain responses as potential SVG image if strings.Contains(mimeType, "text/plain") && len(buf) > 8 { if bimg.IsSVGImage(buf) {