Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97639 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11061 invoked from network); 9 Jan 2017 20:19:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2017 20:19:26 -0000 X-Host-Fingerprint: 95.150.123.240 unknown Received: from [95.150.123.240] ([95.150.123.240:25560] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/81-31343-C40F3785 for ; Mon, 09 Jan 2017 15:19:25 -0500 Message-ID: <08.81.31343.C40F3785@pb1.pair.com> To: internals@lists.php.net References: <2cee1fe1-6dfd-0337-7286-42f873b9f508@gmx.de> Date: Mon, 9 Jan 2017 20:19:20 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: <2cee1fe1-6dfd-0337-7286-42f873b9f508@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 95.150.123.240 Subject: Re: ext/gd: support creation of animated GIFs From: ajf@ajf.me (Andrea Faulds) 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/