Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102063 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96887 invoked from network); 19 Apr 2018 23:09:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Apr 2018 23:09:58 -0000 Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.19 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.19 mout.gmx.net Received: from [212.227.15.19] ([212.227.15.19:33673] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/73-38944-2C129DA5 for ; Thu, 19 Apr 2018 19:09:55 -0400 Received: from [192.168.2.105] ([91.8.175.66]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MXIcX-1ewyst2XGX-00WGAb; Fri, 20 Apr 2018 01:09:50 +0200 To: Kalle Sommer Nielsen Cc: PHP internals References: <741f89af-a199-6501-17cc-f1e10a858bb2@gmx.de> Message-ID: Date: Fri, 20 Apr 2018 01:09:51 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:MmuIDKMiITjE2UoZPSffIDghm1Y+1wZMSHPgA5/Gm5M/yfuOIg7 ocC4bYHv+KIQ0z+a0Pj2oya7Txn3TU9HwR8RaWuhkFxtgE5qEen7s4EkVeOkXQOxYqK4AUJ dwUbhLtDXPwXR5rz5SSINmlxP7n4FS3g7yBo3zBXt/DteSLreBE/1KBLZEEVg5CTNk45ESx xCQSEAZX/W00stTpbVuqg== X-UI-Out-Filterresults: notjunk:1;V01:K0:4nOyDAoUkVs=:XgBqm+MXGjgF07XGZz9CR4 hT8Kh568ZexBhaR6Szu666ga3+egnxJwenFAR+KpuD105wH/OP0lkviSG0BT1SFBlHYnSgfQO 3jzCKv9VIARH++8+MT15aAkbnwWs4hzAJOvnoIjqYYsjtwqPt3v8EWt6QUcvdCiINud/gQhni 8jQcFPxTjIqaXL6TSX3HcxH3dAF2ynslsKw5o5KfSzefnHyx2Ou6U7843nsX0cmOmx+jkWDIO /iMlZh42j/RigZrtf18omvHAaXDCtzAiCvyOuG3JhEE1TQMPc7tXNQ+74iKkEGVJ2JaIZLmz9 wUSut7k2rDiVf0NeUCgO1AwCiQ/GgaHepnR3f67KCTdqVGh5xMPR7mA0RasFFDPcqYLyKOa0Z saKZRa5oAiXcuuMrw+UpcoQ5A/XP2Qy+1uTjgaI6ERdDvJMy8If0rbtK53Ck9Q++C7GqXc/EC dvLzSamy5mZ9/mSADuICT73Yj0cRCjnNCHG6hNW59Ke+pqJOQIwLmz25U1iXjaajT+Ox0pSQn zodIZKCvRPoA0EkOkTUGV/eOWL/SI+He/NymbHN3AVnxWf7VEYqkGsC52Kr7JzEyjGSBFHjqV pR1wp0VvGFAmG1WCHYGzNKDITx7sut/gOqAiT78xq82U8Vyx4JhSXfx0jjHvPF4zjDDfdLti8 zKsO3vfcbEDwKqmIL2FhO/Z7mUiWDN8yTXMePlHf59t8tjdHjSUwB1Myxaof362gZgeqZ4XBk 2+zbhxfmm4ZRukAj0yH4jxaEtwtBJ569JZSMbSX9MYoZtxY9nasm3YsnM+aYD7eH40EJN7ZSU olsjDTuMb5+jLsoJTX/oMcReU4kUXYYTdA8S+oQ/4hUs1mMSLU= Subject: Re: [PHP-DEV] What to do with image2wbmp()? From: cmbecker69@gmx.de ("Christoph M. Becker") On 13.04.2018 at 06:58, Kalle Sommer Nielsen wrote: > 2018-04-05 14:04 GMT+02:00 Christoph M. Becker : > >> is still unresolved, and I'm not sure how >> to resolve it. >> >> TL;DR: the $threshold parameter of image2wbmp() is supposed to specify a >> *brightness threshold* for the required black and white conversion of >> the image. However, as of PHP 5.0.0 it is actually interpreted as the >> *foreground color*; all other colors are treated as background. This >> makes image2wbmp() basically identical to imagewbmp(). > > If thats the case that its basically identical, then a PHP_DEP_FE > should be sufficient for image2wbmp() and a removal in future version, > given its a rarely used function and migration is easy, even 7.4 could > potentially be fine for removal. Thanks, Kalle! To clarify the behavioral problem: image2wbmp() is supposed to use _php_image_bw_convert() to do the conversion. However, that does not happen anymore since the commit[1] I've mentioned in the bug report. The problem is that the fallthrough to case PHP_GDIMG_TYPE_JPEG[2] had been intended (but not documented!), so that _php_image_bw_convert() (which is stored in func_p) would have been called, but now gdImageWBMP()[3] is called directly without converting to a black and white image according to the given threshold. It is quite interesting that it took apparently more than *ten* years until the bug has been reported[4]. This might be due to nobody using WBMP (see , though). Anyhow, I have to agree to the deprecation/removal suggestion, since: * fixing *this* 10y old bug is likely to cause more harm than good * a B/W conversion should be a *general* feature of GD (or likely rather libgd) * the B/W conversion[5] is very simplistic, and does not fit to gdImageGrayScale()'s[6] algorithm[7] I shall pursue the RFC process. [1] [2] [3] [4] [5] [6] [7] -- Christoph M. Becker