You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate image pipeline from RMagick to libvips (1.2.0)
Direct ruby-vips swap, no image_processing gem fallback, RMagick
dropped from the gemspec. Bumps CheesyGallery::VERSION to 1.2.0 so
the user-visible install change is signalled by SemVer.
* base_image_file.rb: `process_and_write` signature changes from
`(img, dest_path)` to `(source_path, dest_path)`. The base class
no longer opens the source file; the default body is `FileUtils.cp`
and subclasses own decode+resize+write via `Vips::Image.thumbnail`.
PR #416's `render_cache_discriminator` hook is preserved as-is.
* image_file.rb: ping path uses `Vips::Image.new_from_file(...).autorot`
inside the Geometry-cache getset block. The cached `[h, w]` tuple
is now stashed on the instance (@geometry) so `process_and_write`
doesn't re-ping. Resize uses `Vips::Image.thumbnail(path, w, height:,
size: :down, crop: :none)` — `size: :down` is the libvips analogue
of PR #416's shrink-only `>` flag. JPEG written with `Q:`, `interlace:
true`, `strip: true`, `optimize_coding: true`. `geometry_string` is
preserved verbatim for cache-key fingerprint compatibility with
PR #416; under libvips its value is decorative and only feeds the
Geometry/Render cache keys. A new private `fit_inside` replicates
the shrink-only WxH math in plain Ruby.
* image_thumb.rb: `Vips::Image.thumbnail(path, w, height: h,
crop: :centre)` matches RMagick's `resize_to_fill!`. Thumbs now use
the same size-optimisation flags as full-size renders, at Q80.
* cache_spec.rb: spies retargeted onto `Vips::Image.new_from_file` and
`Vips::Image.thumbnail`. Counts stay numerically identical because
cached geometry is threaded into `process_and_write` — there is
still exactly one "ping" per source on a Geometry-cache miss and
one fused decode+resize per variant on a Render-cache miss. The
three-segment Geometry-key test and Render-discriminator test from
PR #416 pass verbatim (the discriminator infrastructure is
library-agnostic).
* generator_spec.rb: output-dimension verifiers swapped from
`Magick::Image.ping(dest).first` to `Vips::Image.new_from_file(dest)
.autorot`. PR #416's pinned dimensions `[1000, 750]` (default
`1920x1080`, shrink-only) and `[533, 400]` (`600x400` override)
match libvips under `fit_inside`.
* Gemfile.lock under spec/fixtures/test_site regenerated; ruby-vips
2.3.0 replaces rmagick.
Behaviour changes are documented in CHANGELOG.md:
- EXIF Orientation is now honoured (libvips' `thumbnail` auto-rotates
before downsample; output drops the orientation tag). Latent bug fix
for sideways sources.
- Thumbnails are now progressive Q80 JPEGs with stripped metadata
(was: RMagick defaults — baseline, ~Q75, EXIF retained).
- `max_size` flags other than `>` (i.e. `!`, `^`, `@`, `#`) are now
silently treated as plain `WxH`. cheesy-gallery's own config never
used them; full ImageMagick geometry syntax was out of scope.
Perf characterised in docs/libvips-bench.md: 3.35x faster on
DSLR-sized inputs, modest regression on web-sized inputs, RAM roughly
comparable. The migration is justified by the DSLR speedup plus
non-perf wins (escape from RMagick CVE / build-pain, correct EXIF
Orientation handling).
https://claude.ai/code/session_01AZQRrnPUpfUMCXLu3oTSDN
0 commit comments