On Sat, Jun 5, 2021 at 11:09 PM Ayesh Karunaratne <ayesh@php.watch> wrote:

> Hi Ben,
> Thank you for opening this PR and the discussion. With the wide
> availability of AVIF/AV1 support in browsers, I think this will fit
> nicely.
>

Yes, this looks like a reasonable addition. Effectively this is just a sync
with upstream libgd, and the exposed API follows existing conventions.


> We have the Namespaces in Bundled Extensions RFC
> (https://wiki.php.net/rfc/namespaces_in_bundled_extensions) passed, so
> perhaps, the new functions are probably better in the `Gd` namespace?
> This would mean the new functions would be `\Gd\imagecreatefromavif`
> and `\Gd\imageavif`. They are inconsistent with the existing functions
> of course, but I thought to mention it because it's a recent proposal
> and I don't think we added new functions after that RFC. Some examples
> are recently renamed PHP classes in IMAP, Pgsql, LDAP, and FTP
> extensions to follow this new proposal.>
>

See
https://wiki.php.net/rfc/namespaces_in_bundled_extensions#existing_non-namespaces_symbols_and_consistency
:
> When adding new symbols to existing extensions, it is more important to
be consistent with existing symbols than to follow the namespacing
guidelines.

Unless we introduce namespaced aliases for the gd extension first, these
functions should not be namespaced either. As Mark pointed out, in the case
of GD it might make more sense to move to an OO API rather than a new set
of namespaced functions. In any case, I don't think this is the place to
discuss this.

Regards,
Nikita

Reply via email to