Explorar o código

Fix copy memory on WebP size check

DarthSim %!s(int64=4) %!d(string=hai) anos
pai
achega
ca97c715a4
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      process.go

+ 3 - 3
process.go

@@ -429,10 +429,10 @@ func transformImage(ctx context.Context, img *vipsImage, data []byte, po *proces
 				return err
 			}
 			logWarning("WebP dimension size is limited to %d. The image is rescaled to %dx%d", int(webpMaxDimension), img.Width(), img.Height())
-		}
 
-		if err = copyMemoryAndCheckTimeout(ctx, img); err != nil {
-			return err
+			if err = copyMemoryAndCheckTimeout(ctx, img); err != nil {
+				return err
+			}
 		}
 	}