Skip to content

bound withDensity and withMetadata density to a valid range - #4631

Merged
lovell merged 1 commit into
lovell:mainfrom
metsw24-max:output-density-bound
Oct 12, 2026
Merged

lovell merged 1 commit into
lovell:mainfrom
metsw24-max:output-density-bound

Conversation

@metsw24-max

Copy link
Copy Markdown
Contributor

Unbounded output density

The density given to withMetadata() and withDensity() was only checked as a positive number, so a value such as 1e8 is accepted but then falls outside the libvips xres/yres property range, which logs a GLib-GObject-CRITICAL and silently clamps the stored resolution. Bounded both setters to 1-100000 so an out-of-range value is rejected up front, matching the existing density input option.

@lovell
lovell merged commit 3c54980 into lovell:main Oct 12, 2026
33 checks passed
@lovell

lovell commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Thank you for adding this

@lovell lovell added this to the v0.35.6 milestone Oct 12, 2026
lovell added a commit that referenced this pull request Oct 12, 2026
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