Skip to content

Conversation

@tonytw1
Copy link
Member

@tonytw1 tonytw1 commented Jul 27, 2025

What does this change?

Image ingestion and thumbnail generation implemented using libvips.
Around a 4x reduction in the time taken to ingest an image.

The getColorModelInformation call to ImageMagick identify was one of the unexpectedly expensive (seconds for large image) calls.
We are avoiding this by inferring colourModel from VIPS metadata rather than the output of identify.

Image dimension and orientation metadata is sourced from libvips.

Uses vips-ffm as the vips Java binding.

Opinionated decision to stop generating the optimisedPng pre renders (because vips proxy is faster enough for all image types).
Kahuna ignores existing optimisedPng files.

Tests will need to know the location of libvips libraries when run on an Apple Silicon brew libvips install.

sbt -Dvipsffm.libpath.vips.override=/opt/homebrew/lib/libvips.dylib -Dvipsffm.libpath.glib.override=/opt/homebrew/lib/libglib-2.0.0.dylib -Dvipsffm.libpath.gobject.override=/opt/homebrew/lib/libgobject-2.0.0.dylib test

How should a reviewer test this change?

How can success be measured?

Who should look at this?

Tested? Documented?

  • locally by committer
  • locally by Guardian reviewer
  • on the Guardian's TEST environment
  • relevant documentation added or amended (if needed)

@tonytw1 tonytw1 changed the title Libvips Libvips image loading Jul 27, 2025
@tonytw1 tonytw1 force-pushed the gcp-storage-buckets branch from 33a2a52 to f49a509 Compare August 2, 2025 18:23
@tonytw1 tonytw1 force-pushed the gcp-storage-buckets branch from f49a509 to a3cfe7a Compare August 2, 2025 19:38
@tonytw1 tonytw1 force-pushed the gcp-storage-buckets branch from a3cfe7a to f23d157 Compare August 3, 2025 10:41
@tonytw1 tonytw1 force-pushed the gcp-storage-buckets branch 7 times, most recently from 58edbd5 to bd3a973 Compare August 9, 2025 17:44
@tonytw1 tonytw1 force-pushed the libvips branch 2 times, most recently from c8f8217 to c96ff82 Compare August 11, 2025 19:06
@tonytw1 tonytw1 force-pushed the gcp-storage-buckets branch 3 times, most recently from a232cac to 0d3403d Compare September 21, 2025 18:42
@tonytw1 tonytw1 force-pushed the libvips branch 5 times, most recently from d296629 to 25c0148 Compare September 28, 2025 10:12
@tonytw1 tonytw1 force-pushed the gcp-storage-buckets branch 5 times, most recently from b8041b2 to 2e351c4 Compare November 23, 2025 12:37
…saving for thumbnails.

3751 bytes vs 4067 bytes for a 140x100 thumbnail.

optimize-scans is only useful on progressive jpegs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants