Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116543 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10263 invoked from network); 30 Nov 2021 22:54:39 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Nov 2021 22:54:39 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4DE1B180211 for ; Tue, 30 Nov 2021 15:53:13 -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=-14.9 required=5.0 tests=BAYES_50,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) (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 ; Tue, 30 Nov 2021 15:53:12 -0800 (PST) Received: by mail-yb1-f175.google.com with SMTP id f186so57684509ybg.2 for ; Tue, 30 Nov 2021 15:53:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=o9/9viNo1tP9W+1j29DDHgIosGB07mOWvxYIR3RjpjM=; b=NRV29vcNg6zpTMwUYn1Ru+zJ7RoMKzkfpHo6H8+K6pFXhe7f287Ub95qnE5BLI1id4 6CSeOx2mUpugIrJNVOQCtX/p9JvLJxR2mrgVjJoQbKNznPRj7faZAdESpj354PwTMs6y X5/IIBhEsHyPbZAWUryCqotDGuK4U7arIc7EiAlTGkFXLfCK543q08/vIhDFy0MzP73E AD71upOpkoDCMYhCxguv7WyupeMAgWxyOfVwOIGfIYh3mAZx9zJhlQjVWvlXz76/gyFS UGR/TQsreUTDIij7sctjC+NJ+cic9NVZJMoHJPT8eRJMGC97RIgiXPhXotOf1dOmevD+ Ru1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=o9/9viNo1tP9W+1j29DDHgIosGB07mOWvxYIR3RjpjM=; b=Kb38JlGVUCWctx5kMqmTw1plivnAtv/kc2oA5SN7jOeuFECWT0knLC6xLBb3UwRsd4 dC/YooTGQ/cxllr2ns00pJyzphnP9/vwKvXYvu3zAn8eEDrKGvb1pXTRqgKtbEaEQdun Hr33gHVXPe91gyNQtsSacHeOSK+NnPy92oNYH683Ssp50IqXgUD2xu3hR/xzr3HbnPNO CMeoRLj46ArfWRt8CLMjyBXzPx0VVFK9/7sxdCqxgFRCRJKWaeHRq/zdbTPiAVBo2QFN dY5EPmZKJhr9Ee747lvMYpN/bjks3M/ZqRYQPjtg2ETqLW2CCnZkHJIpVlMZ4Vs+VmBf noiA== X-Gm-Message-State: AOAM531qAGqqIqFJg2URmSIkXEBicLEvVmM1YWGjMnr+KILhQHSvNCLs 0lDEsckUFsBA4Y+pVOXJrFXhyYXXf6tRfN7h/m/8BYtnxh1XlKBH X-Google-Smtp-Source: ABdhPJzJ8lTVtTap2Wz3TlELbwKShl+LG90SqwghtNG22ymTebfgJSeF9VsRJyPihLoaxbLBAw4mpo2QwOYOOFvxH2s= X-Received: by 2002:a25:d98c:: with SMTP id q134mr2705205ybg.329.1638316391441; Tue, 30 Nov 2021 15:53:11 -0800 (PST) MIME-Version: 1.0 Reply-To: Ben Morss Date: Tue, 30 Nov 2021 18:52:54 -0500 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000008b237d05d20a4292" Subject: Finishing AVIF support in getimagesize() From: internals@lists.php.net ("Ben Morss via internals") --0000000000008b237d05d20a4292 Content-Type: text/plain; charset="UTF-8" Hello everyone! 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 works well. Would it be ok to submit a PR containing this code to add this functionality? Or does someone have a superior approach? Thanks, and all best, Ben --0000000000008b237d05d20a4292--