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

ezcGraphGdDriver->getTextBoundings() returns null without FreeType support installed #15

Open
elazar opened this issue Apr 12, 2015 · 2 comments

Comments

@elazar
Copy link

elazar commented Apr 12, 2015

If the gd extension is installed, but FreeType support isn't enabled, ezcGraphGdDriver->getTextBoundings() can return null because neither of the case blocks in this switch block will be executed. This can cause less than intuitive errors like the one below when calls like this one don't check the return value to ensure it's an object. It may be best to have ezcGraphGdDriver->getTextBoundings() throw an exception if no case blocks are matched.

PHP Notice:  Trying to get property of non-object in /home/matt/Software/spl-benchmarks/vendor/zetacomponents/graph/src/driver/gd.php on line 565
@derickr
Copy link
Member

derickr commented Apr 13, 2015

I agree - would you mind making a PR? :-)

@elazar
Copy link
Author

elazar commented Apr 13, 2015

I can make the code change, but I'm not sure how to go about updating the tests since the GD driver test suite has a check in setUp() that marks the test skipped if FreeType support isn't enabled. Thoughts?

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

No branches or pull requests

2 participants