Re: ext/gd: support creation of animated GIFs

From: Date: Mon, 09 Jan 2017 20:19:20 +0000
Subject: Re: ext/gd: support creation of animated GIFs
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-97639@lists.php.net to get a copy of this message
Hi, Christoph M. Becker wrote:
Kalle raised some objections regarding the direct use of streams in the API, namely that imagegifanimbegin() expects an open stream to be passed as parameter, so perhaps it would be better to accept a stream URL instead and manage the stream behind the scenes. That appears to be much more solid (as the developer couldn't fiddle with the stream), but would require some encapsulation mechanism, either a resource, what would be in line with the other GD resource types[4], or an (opaque) object, what appears more suitable for PHP 7. Currently, I'd prefer an *opaque* object which would be created by imagegifanimbegin() (creating the respective stream internally), passed to imageanimadd() and be destroyed by imagegifanimend().
Would this opaque object still allow you to use an arbitrary stream of your choice? Also, like with imagepng() etc., could you stream the output to uh… PHP's default output stream? (I'm not sure what it's called. The thing that echo goes to.) If it does both, I don't have much objection. Mind you… is it really necessary to hide the stream from the user? fopen() is not particularly hard to use, and there are (admittedly niche) cases where you might want to handle the stream yourself. Thanks. -- Andrea Faulds https://ajf.me/

« previous php.internals (#97639) next »