Skip to content

Conversation

@JanRomero
Copy link
Contributor

Currently, if you call $img->maxSize(0, 300) or $img->maxSize(0, 0) on an image that is already within those dimensions, it will not create a variation but return a PageImage as if it had, resulting in a PHP warning and a 404 for the image:

Warning: filesize(): stat failed for <myfile>.0x0.jpg in <mytemplate>

In fact, this problem still happens for $img->size(0, 0), so perhaps a better fix would be somewhere deeper down the callstack. I’m using the default ImageSizerEngineGD here.

This is kind of hackish anyway, passing down the original image dimension instead of 0. Maybe it even breaks something somewhere, but it seems to scratch my personal itch okay at this time. Is there a test suite to make sure PRs don’t break anything?

Thanks!

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