aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd/server/main.go8
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)