1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-06-17 22:37:33 +02:00

Check timeout automatically

This commit is contained in:
DarthSim
2022-06-23 17:23:04 +06:00
parent d80a203390
commit a44e8dc94b
8 changed files with 9 additions and 25 deletions

View File

@ -140,7 +140,7 @@ func transformAnimated(ctx context.Context, img *vips.Image, po *options.Process
return err
}
if err = copyMemoryAndCheckTimeout(ctx, img); err != nil {
if err = img.CopyMemory(); err != nil {
return err
}
@ -264,10 +264,6 @@ func ProcessImage(ctx context.Context, imgdata *imagedata.ImageData, po *options
}
}
if err := copyMemoryAndCheckTimeout(ctx, img); err != nil {
return nil, err
}
if po.Format == imagetype.AVIF && (img.Width() < 16 || img.Height() < 16) {
if img.HasAlpha() {
po.Format = imagetype.PNG