Hi!

A while ago I've grabbed up <https://bugs.php.net/32803> and submitted
PR #2024[1].  This lay dormant until recently when Joe had a look at so
many PRs (thanks!), so I'm bringing this issue to your attention.

I presume nobody is opposed that ext/gd should support the creation of
animated GIFs (they appear to be still in fashion again), but I'm not
sure about the API.  My first shot (as implemented in the PR) was to
offer a rather minimal layer over gdImageGifAnimBeginCtx(),
gdImageGifAnimAddCtx() and gdImageGifAnimEndCtx()[2] (you can see an
usage example in the submitted PHPT[3]).

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().

Before proceeding to the implementation, I'd like to hear your thoughts
about that!

[1] <https://github.com/php/php-src/pull/2024>
[2] <https://libgd.github.io/manuals/2.2.3/files/gd_gif_out-c.html>
[3]
<https://github.com/php/php-src/pull/2024/files#diff-bbb4c7a8497032f98d062ac418d9fbbe>
[4] <http://php.net/manual/en/image.resources.php>

-- 
Christoph M. Becker

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to