Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116619 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61217 invoked from network); 9 Dec 2021 23:38:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Dec 2021 23:38:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 543281804AA for ; Thu, 9 Dec 2021 16:39:22 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (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 16:39:21 -0800 (PST) Received: by mail-pf1-f177.google.com with SMTP id p13so7001788pfw.2 for ; Thu, 09 Dec 2021 16:39:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lSIN5uzjVh0ms71GfnWczcsIsRAY5MAX0f5N8Y1GMzg=; b=IYUZV03vQnMV0VidRVtcpnN48x/GFudcNJR2KwFwPi/QAknLB/NC12O5CW4/3+l6rM DuedemsTrZ8ptMYIPIWIWZq20dVPP71DmZJphVOq2r186UtY9rN6/62PJgvqbNZXNtrE Hn4AuwxAkxWHsZT+eC7EaHzPBryOektD9U5tdPrXPdkLmmAOBVt/LmmbG9d+9Oc+GbTJ Sd5f9NroA7nAcIVT9Jtc+CMmeNy/q2krqEb29vebQVKYA+mmNHwRXXYrGMfn+N3Spjoo dPntdGJ/GkbCTBaiAsSIie0cDbMajNUFbCHKN25ycK10ZZ5HtZwGYXZj2xPUzvGZC26Z UP3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lSIN5uzjVh0ms71GfnWczcsIsRAY5MAX0f5N8Y1GMzg=; b=3/UmWIYsGEs+RZGKnZw+aQRGYRmnvTOTnc/y/PoImZprmRhPua+ffJvRCutq+sSWPO oGib0vN0/BCB3sdbG/3s8s8Fv5wUqdhT++zqhchtEMA7WWB28EC5SorRyuYOR4JiOZoH EIRnTvHb1zXVSSRI4nhw2EBNMwxeZ2i7/1RmbMkjYIZBpMdVJf/4/vG0rfTWWLspTwKj TA9h5t8u8/VY6JRWUs5tam0V6Bdf4DyRZwtbf6KvAsHXdJvyY1VI27MShGDj/LT/Y2Vc A2TQHg6QAK+rDoYOS7bwOBaPUFt6PS2a6srDFj63G1A4C6EMAhhvia2lCNl8dB4CZrjM pbog== X-Gm-Message-State: AOAM533VT0N3QouAdQZ1IBWtlnkBdwh4SEz9XnM4r2wQdkbJHq2/GEoQ oLG7GnN6GTZDo9wpPWiifl9H2D88JLMPkohXAcs= X-Google-Smtp-Source: ABdhPJy60yUIZItQX8jVgwKLkMoFwhKEF067F8RFXEus+5F87WWaUbW/b0eu0PVMUPkwdSAtAsHJKbMskl9yH3s1NkA= X-Received: by 2002:a63:ef44:: with SMTP id c4mr36544806pgk.146.1639096760606; Thu, 09 Dec 2021 16:39:20 -0800 (PST) MIME-Version: 1.0 References: <7c4411c8-8bf6-36f1-36f8-1a7391c2a3d7@gmx.de> <4e195dd4-ecb5-fcb5-668f-cabb9635b74a@gmx.de> In-Reply-To: <4e195dd4-ecb5-fcb5-668f-cabb9635b74a@gmx.de> Date: Thu, 9 Dec 2021 21:39:09 -0300 Message-ID: To: "Christoph M. Becker" Cc: Nikita Popov , Ben Morss , PHP internals Content-Type: multipart/alternative; boundary="0000000000002b254205d2bff4d3" Subject: Re: [PHP-DEV] Re: Finishing AVIF support in getimagesize() From: flaviohbatista@gmail.com (=?UTF-8?Q?Fl=C3=A1vio_Heleno?=) --0000000000002b254205d2bff4d3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 9, 2021, 18:56 Christoph M. Becker wrote: > 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 > >>>> > that > >>> 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 wor= ks > >>> 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 o= f > >>> 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 libavifin= fo > > 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. > > -- > Christoph M. Becker > Got it! I was refering to the general avif support, glad to see that it's already there =3D) > --0000000000002b254205d2bff4d3--