Skip to content

FIX: validate fixed AddImageText font size - #2563

Open
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 2 commits into
microsoft:mainfrom
sylvesterkaczmarek:fix/add-image-text-font-size-validation
Open

FIX: validate fixed AddImageText font size#2563
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 2 commits into
microsoft:mainfrom
sylvesterkaczmarek:fix/add-image-text-font-size-validation

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Description

AddImageTextConverter validates automatic (min, max) font-size ranges to require positive sizes, but fixed integer font_size values are accepted without validation.

Values such as font_size=0 or a negative size therefore reach Pillow's font loader and fail there instead of being rejected as invalid converter configuration.

This change applies the same positive-size invariant to fixed font sizes and raises a clear ValueError during initialization.

Tests

Adds regression coverage for zero and negative fixed font sizes.

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