Take the State of PHP 2026 Survey →

Deprecate png2wbmp() and jpeg2wbmp() View as Markdown

Implemented (PHP 7.2)
Authors
Christoph M. Becker, cmb@php.net
Date
2016-10-15
Version
1.1
Source
wiki.php.net/rfc/deprecate-png-jpeg-2wbmp

Vote

Deprecate png2wbmp() and jpeg2wbmp() closed
Yes
20
No
0
20 voters
ajf Yes 2016-10-31 14:10
bwoebi Yes 2016-11-10 18:56
cmb Yes 2016-10-31 16:17
colinodell Yes 2016-11-01 12:42
daverandom Yes 2016-11-11 11:54
galvao Yes 2016-11-01 02:54
guilhermeblanco Yes 2016-11-01 02:39
jhdxr Yes 2016-11-13 17:32
kalle Yes 2016-10-31 12:02
kguest Yes 2016-11-03 21:45
levim Yes 2016-11-06 19:00
mbeccati Yes 2016-10-31 16:52
mgocobachi Yes 2016-11-09 09:19
mrook Yes 2016-11-07 12:19
ocramius Yes 2016-11-08 12:55
pierrick Yes 2016-11-04 18:57
sammyk Yes 2016-11-02 14:45
santiagolizardo Yes 2016-10-31 14:35
svpernova09 Yes 2016-11-09 16:03
zimt Yes 2016-11-08 09:20

Discussions on the mailing list

ext/gd: Deprecate png2wbmp() and jpeg2wbmp()
by Christoph M. Becker · 7 messages
[RFC] Deprecate png2wbmp() and jpeg2wbmp()
by Christoph M. Becker · 1 message
[VOTE] Deprecate png2wbmp() and jpeg2wbmp()
by Christoph M. Becker · 4 messages

RFC text

Copied from wiki.php.net, last synchronized Oct 13, 2026 11:51 UTC

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 1). Furthermore WBMP 2) has been invented to support WAP 3), 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 (_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 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.

Vote: Deprecate png2wbmp() and jpeg2wbmp() — Yes: 20 · No: 0 (closed)

Patches and Tests

PR implementing the deprecation: https://github.com/php/php-src/pull/2164.

Implementation

  1. PR #2164 has been merged into master (what is supposed to become PHP-7.2) with https://github.com/php/php-src/commit/189bbb58
  2. The deprecation and removal has been documented with http://svn.php.net/viewvc?view=revision&revision=341003
  3. Removed for PHP 8
  4. The language specification is not affected by this RFC

References

1)instead they are defined in the libgd binding using libgd's image reading and writing functions

2)Wireless Application Protocol Bitmap Format

3)Wireless Application Protocol