1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-18 11:12:10 +02:00

Fix crashes in cases where the max_bytes processing option was used and image saving failed

This commit is contained in:
DarthSim 2023-04-19 17:04:36 +03:00
parent 41b9ebe927
commit 4fae754071
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,8 @@
# Changelog
## [Unreleased]
### Fix
- Fix crashes in cases where the `max_bytes` processing option was used and image saving failed.
## [3.16.0] - 2023-04-18
### Add
@ -65,7 +67,7 @@
- (pro) Allow usage of floating-point numbers in the `IMGPROXY_VIDEO_THUMBNAIL_SECOND` config and the `video_thumbnail_second` processing option.
### Fix
- Fix craches in some cases when using OpenTelemetry in Amazon ECS.
- Fix crashes in some cases when using OpenTelemetry in Amazon ECS.
- (pro) Fix saving of GIF with too small frame delay to MP4
## [3.12.0] - 2022-12-11

View File

@ -211,7 +211,7 @@ func saveImageToFitBytes(ctx context.Context, po *options.ProcessingOptions, img
for {
imgdata, err := img.Save(po.Format, quality)
if len(imgdata.Data) <= po.MaxBytes || quality <= 10 || err != nil {
if err != nil || len(imgdata.Data) <= po.MaxBytes || quality <= 10 {
return imgdata, err
}
imgdata.Close()