Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116616 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49980 invoked from network); 9 Dec 2021 20:56:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Dec 2021 20:56:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 822F118053F for ; Thu, 9 Dec 2021 13:56:54 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8560 212.227.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 9 Dec 2021 13:56:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1639087011; bh=EzJcW2Ov4yrwglJ2aPrY57kUFytc+bV2qSEGdalNzRk=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=LLKSyzQZbzKnv9C0kNoSq5VFgBcsd8MGUTSVrzG2qc4EiMcSL7CownQhc64TfyQva 6Rge4Ia4vt1XN4ycOmKhCKNf51BBsgCJLeXafO2gEw7NpYo7wTB1zr25umXi0TTOUL OwIz047T4LZc/k7lc0XmEuF598IKU0O/7roVYfTQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.130] ([84.179.239.183]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M9nxt-1msP0Z35s5-005rj5; Thu, 09 Dec 2021 22:56:50 +0100 Message-ID: <4e195dd4-ecb5-fcb5-668f-cabb9635b74a@gmx.de> Date: Thu, 9 Dec 2021 22:56:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Content-Language: de-DE To: =?UTF-8?Q?Fl=c3=a1vio_Heleno?= , Nikita Popov Cc: Ben Morss , PHP internals References: <7c4411c8-8bf6-36f1-36f8-1a7391c2a3d7@gmx.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:N0JpqJXr4vZ214MhvEcbkGfoUpFcUn4E1NaADNHXnERnhTBJTBX lX7F8V6++n9hpPnf3YNxWvpRcju+bDB2gWQpCwgOcCuBUED3O62rGtER9UBKCAqkHnAZeuM jK5GZ6M/gfswVedNv61WtGfCOvm+TnNprVrkcqW6Vkth5k3r2K0//ygUvArm+5rmkbFRCzM UsAx14P/8NDQEp+W8BZJw== X-UI-Out-Filterresults: notjunk:1;V03:K0:58+/mZY6+SY=:zCy4b0jJRM8XkoxAPKYFsF 04wNd6Ay/o1htEKmX5IEMkzaSrl4VBLZOcB8hWSN4CWd2IQME6D4qOAx2v9ZnYKEq2twqCYT/ gPlgxD+nNsCaWj9lzvv4zVG/tDrr3BT1EgSh/rEJAvd54BkE7eZlmjhhjV8nIAgz/3tES0Xfr 3MInIGrYlW9amFQmwVSwxwMR5lYqInrLth386hy2XkuV0nZPNzjNF6+HS63Na8CeKvLAJnzco ijER7/EbraUU5RTk3E8wvKHazCgbJFkvaDBs78dbVNeiFIYlBR+o6E2M0WV486CyKwDBAL/B9 +EpmPtMc2+S2Kc0E0bevqE2ETscBF/xgo07SR7I42ReYvetqiLZrs5iXyzQ+Ht7WCzrWp2LV+ ybU8XAllTaWPS94tFZawogQwCNzqelAFBebtCBkOGRDuIGxl7wuo3epIxkz1W5IoyCkG4yb2T 123FDj6KooyNnWMxUo0TtgNskjowVlDrh761IK4eNcno8AQdXuE3yz+g2kAeqHFlDXf2eReiq php2RvoG8cxKHNOQ+Wkq5K85x6UnuzQAVBkzencGjmR7nA6f8tr/RUNwuHwbcfUD1wIrzqWfR vwM4I7uzChQgSfl26Jfa/UTNFJRwSMFFlYpdwQLMtXPFkQoaVyhNqtTIoDljIRxz04Dr0x+Ym 07RhMCHgsUwnyf/fDTldiZKG28bzsTE6zw38Fk/sXxcoCO7ujB7nCL9iR/fGT+H7Rqd4kv9f5 H2imtx0c+Km3MD9pbxB7ArsYfj0oXgnQuvy1d430bmkB8QV3XBc9Xg2pg1YKFtRwIMBwuhHrN Anqv3Lfnh4cz2sZ73bUQySpeDdBSewFxXyrhQMkiCsF8RyytJCzaGbqKI/+Tgscp/QjoHSg/Q O0IQ3CUESJ+DGL8DDSYd5iA71Llqmkmp1WBLacm5PAsyriaRPvPBUNM/61nAm80SXvd9tZow1 r+GO7jrBxnGJzrpCZMMbvM+Cq2rWzNtnGCkkabzgQjR7ccF+zV33FhwPhlosp42qKGFSC+s5i xZSUQtXoYH2CTp1LFV2u1Vmfclrq9xSPKgW++jBO4CPloNka/lVhyi1u33fW8j7J3yB1f4UQR 5QUUpciBxmizGo= Subject: Re: [PHP-DEV] Re: Finishing AVIF support in getimagesize() From: cmbecker69@gmx.de ("Christoph M. Becker") On 09.12.2021 at 20:59, Fl=C3=A1vio Heleno wrote: > On Thu, Dec 9, 2021 at 4:46 PM Nikita Popov wrote= : > >> On Wed, Dec 8, 2021 at 12:41 PM Christoph M. Becker >> wrote: >> >>> On 01.12.2021 at 00:52, Ben Morss via internals wrote: >>> >>>> Earlier this year, I added support for AVIF images >>>> to libgd >>>> . My ultimate goal was to bring >> support >>> for >>>> this new image format to PHP, so that the world's top CMSs could let >>> sites >>>> serve AVIFs. A few of you kindly guided me as I made my first >>> contributions >>>> to the PHP codebase, propagating libgd's new AVIF support >>>> into PHP's bundled gd fork= , >>>> and adding >>>> AVIF awareness to non-gd >>>> functions like getimagesize() and imagecreatefromstring(). >>>> >>>> Unfortunately, when I worked on getimagesize(), AVIF experts advised >> that >>>> there was no compact, reliable way to determine the size of an AVIF >> image >>>> without relying on an external library like libavif. We decided >>>> tha= t >>> it >>>> was useful to return the information that a given image was an AVIF, >> but >>>> simply to return 0 for the actual dimensions and other details. The >> user >>>> would simply need to decode the image to determine this information. >>>> >>>> Of course, users would really like >>>> to >> use >>>> getimagesize() to return the actual size. So a colleague has kindly >>>> created standalone >>>> code >>> (that >>>> doesn't depend on libavif) to do this, with the goal of adding it to >> PHP. >>>> >>>> The code comprises several hundred lines. But - it works, and it work= s >>> well. >>>> >>>> Would it be ok to submit a PR containing this code to add this >>>> functionality? Or does someone have a superior approach? >>> >>> Thanks for your and your colleague's work! It's highly appreciated. >>> >>> Anyhow, a respective PR[1] has been submitted now, and I'm in favor of >>> bundling libavifinfo. I'm not too concerned regarding the additional >>> size of the PHP binaries which would result by linking it in, but if >>> others are, we could still introduce a configuration option (e.g. >>> `--with-libavifinfo`). >>> >>> Thoughts? Objections to bundling libavifinfo at all? >>> >>> [1] >>> >> >> Assuming no licensing concerns, bundling libavifinfo sounds reasonable.= The >> library is small, our avif functionality is incomplete without it, and = we >> can't expect this to be available as a system library at this time. >> Although I'm not a core contributor, my 2c is that even with libavifinf= o > bundled, a configuration option is > very welcome, the same way we have for png, jpeg, xpm and webp. Whether AVIF support should be included for ext/gd is already configurable. This is solely about the getimagesize(fromstring) and image_type_to_* functions which are part of ext/std. We do not have configuration options for these for the other image formats either. =2D- Christoph M. Becker