====== PHP RFC: Deprecate png2wbmp() and jpeg2wbmp() ====== * Version: 1.1 * Date: 2016-10-15 * Author: Christoph M. Becker, cmb@php.net * Status: Implemented (PHP 7.2) * First Published at: http://wiki.php.net/rfc/deprecate-png-jpeg-2wbmp ===== Introduction ===== ''png2wbmp()'' and ''jpeg2wbmp()'' are the only direct image format conversion functions available in ext/gd which makes them rather special, particularly as libgd doesn't offer any such functions ((instead they are defined in the libgd binding using libgd's image reading and writing functions)). Furthermore WBMP ((Wireless Application Protocol Bitmap Format)) has been invented to support WAP ((Wireless Application Protocol)), which appears to be mostly obsolete nowadays. ===== Proposal ===== Therefore I propose to deprecate the ''png2wbmp()'' and ''jpeg2wbmp()'' functions as of PHP 7.2, and to remove them as of PHP 8.0. During the deprecation phase calling either function should emit an E_DEPRECATED error. The main benefit in doing so would be easier maintainance of the libgd bindings ([[https://github.com/php/php-src/blob/PHP-7.0.12/ext/gd/gd.c#L4018-L4215|_php_image_convert()]] alone accounts for rougly 200 lines). An additional benefit would be to have a slightly cleaner and less confusing API (Why are there no other conversion functions? Why don't these functions follow the general "image" prefix rule?) ===== Backward Incompatible Changes ===== Obviously, code still using png2wbmp() or jpeg2wbmp() would break. However, fallback functions could easily [[http://news.php.net/php.internals/96366|implemented in userland]]. The supposedly long deprecation period should give users ample time to cater to the removal. ===== Proposed PHP Version(s) ===== * Deprecation as of next PHP 7.x * Removal as of next major (supposedly PHP 8.0) ===== Open Issues ===== Currently none. ===== Unaffected PHP Functionality ===== ''imagewbmp()'' and ''image2wbmp()'' are not subject of this RFC, and as such their functionality will remain unmodified. ===== Proposed Voting Choices ===== Deprecate and remove the functions: yes or no. This RFC requires a 50%+1 majority. Voting ends on 2016-11-13, 22:00 UTC. * Yes * No ===== Patches and Tests ===== PR implementing the deprecation: https://github.com/php/php-src/pull/2164. ===== Implementation ===== - PR #2164 has been merged into master (what is supposed to become PHP-7.2) with https://github.com/php/php-src/commit/189bbb58 - The deprecation and removal has been documented with http://svn.php.net/viewvc?view=revision&revision=341003 - [[http://git.php.net/?p=php-src.git;a=commit;h=e9736638828f3037b1b04fc02718d8d04351f9e0|Removed for PHP 8]] - The language specification is not affected by this RFC ===== References ===== * Proposal discussion: http://marc.info/?l=php-internals&m=147637821405185&w=2 * RFC discussion: http://marc.info/?l=php-internals&m=147654153010696&w=2