Skip to content

fix: align the thumbnail drivers on the port and guard a 0 px original (#58) - #60

Merged
ogorzalka merged 2 commits into
mainfrom
fix/thumbnail-driver-deviations
Nov 23, 2026
Merged

ogorzalka merged 2 commits into
mainfrom
fix/thumbnail-driver-deviations

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Closes #58.

Aligns the thumbnail drivers on the port (tests/Contract/Datasets/ThumbnailDrivers.php; THUMBNAIL_KNOWN_DEVIATIONS is now empty):

  • leading slash: PolloraThumbnailDriver trims it before signing;
  • ? and # in a key: BunnyThumbnailDriver encodes them (%3F, %23); a literal % is left as is, as encoding it would change URLs already issued;
  • sizeOf() of the Pollora and imgproxy drivers only recognises declared sizes, imgproxy also excluding the ones it refuses;
  • SizeGeometry: a 0 px original no longer divides by zero (scale and contain return the dimensions as they are; coverRegion() keeps the whole original).

BREAKING: PolloraThumbnailDriver and ImgproxyThumbnailDriver take ImageSizes as a required constructor argument (imgproxy: third, before the base URL). Only the package builds them (ThumbnailDrivers; checked by search in the other repositories); they are not in api-surface.json.

Checked: full suite (626) on five seeds, contract tests, Pint, PHPStan, Rector dry-run on src; the new tests fail without the fix. WordPress integration suite and coverage not run locally.

@ogorzalka
ogorzalka merged commit 67f35cc into main Nov 23, 2026
16 checks passed
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.

Thumbnail drivers disagree on four cases; SizeGeometry divides by zero for a 0 px original

1 participant