mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-10 12:12:40 +02:00
Fix crashes in cases where the max_bytes
processing option was used and image saving failed
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
### Fix
|
||||||
|
- Fix crashes in cases where the `max_bytes` processing option was used and image saving failed.
|
||||||
|
|
||||||
## [3.16.0] - 2023-04-18
|
## [3.16.0] - 2023-04-18
|
||||||
### Add
|
### 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.
|
- (pro) Allow usage of floating-point numbers in the `IMGPROXY_VIDEO_THUMBNAIL_SECOND` config and the `video_thumbnail_second` processing option.
|
||||||
|
|
||||||
### Fix
|
### 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
|
- (pro) Fix saving of GIF with too small frame delay to MP4
|
||||||
|
|
||||||
## [3.12.0] - 2022-12-11
|
## [3.12.0] - 2022-12-11
|
||||||
|
@@ -211,7 +211,7 @@ func saveImageToFitBytes(ctx context.Context, po *options.ProcessingOptions, img
|
|||||||
|
|
||||||
for {
|
for {
|
||||||
imgdata, err := img.Save(po.Format, quality)
|
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
|
return imgdata, err
|
||||||
}
|
}
|
||||||
imgdata.Close()
|
imgdata.Close()
|
||||||
|
Reference in New Issue
Block a user