Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PageImage::maxSize() not generating the expected file, resulting in a Warning #293

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

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