Skip to content

Add WebP shrink-on-load support via scale parameter#516

Open
JakeChampion wants to merge 1 commit intodavidbyttow:masterfrom
JakeChampion:jake/webp-shrink-on-load
Open

Add WebP shrink-on-load support via scale parameter#516
JakeChampion wants to merge 1 commit intodavidbyttow:masterfrom
JakeChampion:jake/webp-shrink-on-load

Conversation

@JakeChampion
Copy link

@JakeChampion JakeChampion commented Mar 9, 2026

Expose the libvips webpload "scale" parameter as WebpScaleFactor on ImportParams, allowing callers to downscale WebP images during decode

Note

Add WebP shrink-on-load via ImportParams.WebpScaleFactor and pass LoadParams.webpScale to the WebP loader scale option

Introduce a WebP scale-in parameter, thread it through createImportParams to LoadParams.webpScale, set it in set_webpload_options, and add tests for dimension changes and option string output.

📍Where to Start

Start with set_webpload_options in foreign.c, then review createImportParams in foreign.go and the ImportParams additions in image.go.

Macroscope summarized dd8f50b.

Expose the libvips webpload "scale" parameter as `WebpScaleFactor` on `ImportParams`, allowing callers to downscale WebP images during decode
@JakeChampion JakeChampion marked this pull request as ready for review March 9, 2026 12:37
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.

1 participant