Re: Proposal: Rename image functions

From: Date: Sat, 04 Nov 2017 21:39:26 +0000
Subject: Re: Proposal: Rename image functions
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-101055@lists.php.net to get a copy of this message
On 04.11.2017 at 18:39, Rowan Collins wrote: > On 4 November 2017 16:40:56 GMT+00:00, Andreas Treichel <gmblar@gmail.com> wrote: > >> The only >> exception is image2wbmp which is renamed to image_to_wbmp. > > What is the difference between imagewbmp and image2wbmp? If we're going to rename things, > shouldn't that difference be made clearer? Or should we be looking to deprecate one of them > anyway? WBMP images are monochrome (at least in practice). Theoretically, image2wbmp() allows to set a threshold (light pixels will become foreground, dark pixels will become background), but imagewbmp() allows only to chose a foreground color (all other pixels will become background). However, this somewhat useful distinction has been removed as of PHP 5.0.0, see <https://bugs.php.net/73317>. Re-introducing the supposed functionality of image2wbmp() doesn't appear to be sensible after that long time, so I'm +1 on deprecating the function. Instead we might consider to add a general function to convert an image to monochrome according to a given brightness threshold. And frankly, I have doubts that WBMP is of any real value nowadays, so we might consider to deprecate both functions (imagecreatefromwbmp() might still be useful to convert old WBMP images to a more contemporary format). -- Christoph M. Becker

« previous php.internals (#101055) next »