Skip to content

v2.20.0

Latest

Choose a tag to compare

@davidbyttow davidbyttow released this 16 Oct 15:51
7952188

Highlights

  • Keep export option: every format-specific *ExportParams struct gains a Keep ForeignKeep field wired to libvips's keep save option (libvips 8.15+). Where StripMetadata is all-or-nothing, Keep is a bitmask: ForeignKeepExif | ForeignKeepIcc retains just those, ForeignKeepNone strips everything, ForeignKeepAll keeps whatever the running libvips supports. Unset means no change; set, it takes precedence over StripMetadata. On libvips older than 8.15 a set Keep returns a clear error (#551)

Behavior changes

  • WebP exports now keep the source ICC profile when StripMetadata is false, matching JPEG, PNG and TIFF. Previously webpsave was always given profile="none", so WebP output silently lost the profile. Files from sources with an embedded profile grow by roughly the profile's size (about 3 KB for sRGB). To get the old output back, set StripMetadata: true or a Keep without ForeignKeepIcc (#552, #556)

Fixes

Animated and multi-page images had several transforms that treated the stacked frames as one tall image:

  • Rotate(Angle90/Angle270) failed with "bad grid geometry" unless every page was loaded. Pages() is the page count of the file, not the loaded count (#553, #555)
  • Rotate(Angle180) and Flip(DirectionVertical) reversed the frame order. Both now operate per frame (#554, #558)
  • Zoom left the page height stale, so a 2× zoom read as twice as many half-height frames (#554, #558)
  • Resize collapsed frames into one tall image whenever pageHeight × scale wasn't a whole number, the #350 "toilet roll" again. The vertical scale is now chosen so the strip is exactly frames × newPageHeight, as vips_thumbnail does. Output is unchanged when the rounding already agreed (#554, #558)

Housekeeping

  • CI actions bumped to actions/checkout@v7 and actions/setup-go@v7 (#550)

Thanks to @diego-choi for Keep and the WebP fix, and to @ailintom for the Rotate fix and the thorough #554 report.