Browse Source

Also destroy the image clone.

eventually
Quentin Barrand 10 months ago
parent
commit
dca535a686
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      pkg/img/img.go

+ 1
- 0
pkg/img/img.go View File

@@ -95,6 +95,7 @@ func Resize(mw *imagick.MagickWand, height, width, quality uint, format string)

func GetMainColor(mw *imagick.MagickWand) (uint, uint, uint, error) {
c := mw.Clone()
defer c.Destroy()

if err := c.SetDepth(8); err != nil {
return 0, 0, 0, fmt.Errorf("could not set the color depth: %v", err)


Loading…
Cancel
Save