diff options
| author | Alexander Rakoczy <[email protected]> | 2021-10-24 02:16:43 -0400 |
|---|---|---|
| committer | Alexander Rakoczy <[email protected]> | 2021-10-24 02:16:43 -0400 |
| commit | eabf7efd61aeb2a1d75ea308c231e08691119439 (patch) | |
| tree | 415076bd5818b1b5b058c1a03fe14e5d068cee67 /cmd/server | |
| parent | d05245f658c9cb7c66998790d9fdb58a419f971c (diff) | |
pls strip exif
Diffstat (limited to 'cmd/server')
| -rw-r--r-- | cmd/server/main.go | 8 |
1 files changed, 6 insertions, 2 deletions
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) |
