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

Image->render() signature #146

Closed
xfra35 opened this issue Jul 27, 2016 · 3 comments
Closed

Image->render() signature #146

xfra35 opened this issue Jul 27, 2016 · 3 comments

Comments

@xfra35
Copy link
Member

xfra35 commented Jul 27, 2016

On the docs, we have the following signature:

$img->render( [ string $imageformat = 'png' [, int $quality [, int $filters ]]] );

But in reality, the render() method takes the same signature as imagejpeg and imagepng, which means the second argument should either be NULL or a string or a stream.

So what do you think guys? Should we fix the docs or fix render()?

Fixing the docs is easy but on another hand, that extra second argument is useless as it should always be set to NULL since render() is meant for output rendering.

The same reflexion applies to dump().

@ikkez
Copy link
Member

ikkez commented Jul 28, 2016

Well as it's not really meant to use that parameter, I think we should patch render() and dump() accordingly.

@KOTRET
Copy link
Contributor

KOTRET commented Jul 28, 2016

atm Image->render is just a wrapper for calling image(jpg|png).
According to the docs it should just output the image to the client, so the method needs a patch to include a null-param.
Sidenote: looks like imagejpg does not support the filters argument.

@xfra35
Copy link
Member Author

xfra35 commented Jul 28, 2016

Ok thanks guys. Fixed then.

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

3 participants