From eabf7efd61aeb2a1d75ea308c231e08691119439 Mon Sep 17 00:00:00 2001 From: Alexander Rakoczy Date: Sun, 24 Oct 2021 02:16:43 -0400 Subject: pls strip exif --- cmd/server/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmd/server') diff --git a/cmd/server/main.go b/cmd/server/main.go index 35fbab2..fbd1530 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -147,6 +147,8 @@ func upload(b *storage.BucketHandle) http.Handler { http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) return } + imagick.Initialize() + defer imagick.Terminate() wand := imagick.NewMagickWand() defer wand.Destroy() if err := wand.ReadImageBlob(img); err != nil { @@ -154,8 +156,10 @@ func upload(b *storage.BucketHandle) http.Handler { http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) return } - for _, prop := range wand.GetImageProperties("") { - wand.DeleteImageProperty(prop) + if err := wand.StripImage(); err != nil { + log.Printf("wand.StripImage() = %v", err) + http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) + return } ct := head.Header.Get("content-type") ext, err := mime.ExtensionsByType(ct) -- cgit v1.2.3-73-g0e29