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

Warning: imagepng() expects parameter 1 to be resource, object given #68

Closed
alexblueacorn opened this issue Apr 20, 2019 · 3 comments
Closed
Labels
invalid This doesn't seem right

Comments

@alexblueacorn
Copy link

Not working.

Screen Shot 2019-04-19 at 10 55 34 PM

Screen Shot 2019-04-19 at 10 55 18 PM

@alexblueacorn
Copy link
Author

I realized I have to do

$svg_resource = $svg_resource->toRasterImage(2000, 2000);
But it still did not created png file correct.

@TheLoneUs
Copy link

@alexblueacorn This doesn't seem like a php-svg issue. imagepng returns a boolean
See: https://www.php.net/manual/en/function.imagepng.php

You can supply a second parameter that may help.

@meyfa
Copy link
Owner

meyfa commented Jul 30, 2019

That is correct. By default imagepng outputs to the browser. If you want it to create a file, supply a file path.

@meyfa meyfa added the invalid This doesn't seem right label Jul 30, 2019
@meyfa meyfa closed this as completed Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants