From b5185bd3a0f2bcd3cbe488700925872511b8dc0b Mon Sep 17 00:00:00 2001 From: DarthSim Date: Wed, 20 Aug 2025 15:54:07 +0300 Subject: [PATCH 1/3] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6b0e014..68989297 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog ## [Unreleased] +### Changed +- (pro) Improve video decoding performance. +- (pro) Respond with `422 Unprocessable Entity` on error during video decoding. + ### Fixed - Fix the `Vary` header value when `IMGPROXY_AUTO_JXL` or `IMGPROXY_ENFORCE_JXL` configs are set to `true`. - Fix connection break when the `raw` processing option is used and the response status code does not allow a response body (such as `304 Not Modified`). From d7772499b9823b437b9587a1ba400381f0b22e62 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Wed, 20 Aug 2025 16:11:18 +0300 Subject: [PATCH 2/3] Fix keeping copyright info in EXIF --- CHANGELOG.md | 1 + vips/vips.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68989297..25ff8f12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Fix connection break when the `raw` processing option is used and the response status code does not allow a response body (such as `304 Not Modified`). - Fix the `If-Modified-Since` request header handling when the `raw` processing option is used. - Fix `X-Origin-Height` and `X-Result-Height` debug header values for animated images. +- Fix keeping copyright info in EXIF. - (pro) Fix generating thumbnails for VP9 videos with high bit depth. - (pro) Fix `IMGPROXY_CUSTOM_RESPONSE_HEADERS` and `IMGPROXY_RESPONSE_HEADERS_PASSTHROUGH` configs behavior when the `raw` processing option is used. diff --git a/vips/vips.c b/vips/vips.c index e36d01c0..c17d98d1 100644 --- a/vips/vips.c +++ b/vips/vips.c @@ -961,7 +961,7 @@ vips_strip(VipsImage *in, VipsImage **out, int keep_exif_copyright) VipsStripOptions opts = { .strip_all = 0, - .keep_exif_copyright = FALSE, + .keep_exif_copyright = keep_exif_copyright, .keep_animation = FALSE, }; From e1764ad580c70e94bd0f01dcc0d21272f29002d2 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Wed, 20 Aug 2025 16:35:37 +0300 Subject: [PATCH 3/3] Rename processing steps: importColorProfile -> colorspaceToProcessing, exportColorProfile -> colorspaceToResult --- .../{import_color_profile.go => colorspace_to_processing.go} | 2 +- .../{export_color_profile.go => colorspace_to_result.go} | 2 +- processing/processing.go | 4 ++-- processing/trim.go | 2 +- processing/watermark.go | 2 +- vips/vips.c | 1 + 6 files changed, 7 insertions(+), 6 deletions(-) rename processing/{import_color_profile.go => colorspace_to_processing.go} (87%) rename processing/{export_color_profile.go => colorspace_to_result.go} (95%) diff --git a/processing/import_color_profile.go b/processing/colorspace_to_processing.go similarity index 87% rename from processing/import_color_profile.go rename to processing/colorspace_to_processing.go index 77e7d999..e670d642 100644 --- a/processing/import_color_profile.go +++ b/processing/colorspace_to_processing.go @@ -7,7 +7,7 @@ import ( "github.com/imgproxy/imgproxy/v3/vips" ) -func importColorProfile(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions, imgdata *imagedata.ImageData) error { +func colorspaceToProcessing(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions, imgdata *imagedata.ImageData) error { if img.ColourProfileImported() { return nil } diff --git a/processing/export_color_profile.go b/processing/colorspace_to_result.go similarity index 95% rename from processing/export_color_profile.go rename to processing/colorspace_to_result.go index df672bad..95aa486c 100644 --- a/processing/export_color_profile.go +++ b/processing/colorspace_to_result.go @@ -6,7 +6,7 @@ import ( "github.com/imgproxy/imgproxy/v3/vips" ) -func exportColorProfile(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions, imgdata *imagedata.ImageData) error { +func colorspaceToResult(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions, imgdata *imagedata.ImageData) error { keepProfile := !po.StripColorProfile && po.Format.SupportsColourProfile() if img.IsLinear() { diff --git a/processing/processing.go b/processing/processing.go index 73f21203..5abbe38a 100644 --- a/processing/processing.go +++ b/processing/processing.go @@ -22,7 +22,7 @@ var mainPipeline = pipeline{ trim, prepare, scaleOnLoad, - importColorProfile, + colorspaceToProcessing, crop, scale, rotateAndFlip, @@ -37,7 +37,7 @@ var mainPipeline = pipeline{ } var finalizePipeline = pipeline{ - exportColorProfile, + colorspaceToResult, stripMetadata, } diff --git a/processing/trim.go b/processing/trim.go index 77cd72a6..fc8b2f68 100644 --- a/processing/trim.go +++ b/processing/trim.go @@ -25,7 +25,7 @@ func trim(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions, } // We need to import color profile before trim - if err := importColorProfile(pctx, img, po, imgdata); err != nil { + if err := colorspaceToProcessing(pctx, img, po, imgdata); err != nil { return err } diff --git a/processing/watermark.go b/processing/watermark.go index 7ad37e77..ac911ea3 100644 --- a/processing/watermark.go +++ b/processing/watermark.go @@ -14,7 +14,7 @@ import ( var watermarkPipeline = pipeline{ prepare, scaleOnLoad, - importColorProfile, + colorspaceToProcessing, scale, rotateAndFlip, padding, diff --git a/vips/vips.c b/vips/vips.c index c17d98d1..481cfca4 100644 --- a/vips/vips.c +++ b/vips/vips.c @@ -407,6 +407,7 @@ vips_icc_is_srgb_iec61966(VipsImage *in) /* Predict it is sRGB IEC61966 2.1 by checking some header fields */ return ((memcmp(data + 48, "IEC ", 4) == 0) && // Device manufacturer + (memcmp(data + 16, "RGB ", 4) == 0) && // Colorspace (memcmp(data + 52, "sRGB", 4) == 0) && // Device model (memcmp(data + 80, "HP ", 4) == 0) && // Profile creator (memcmp(data + 24, date, 6) == 0) && // Date of creation