For a better readability of the gd functions I would like to rename them so that they contain underscores to separate the words. The only exception is image2wbmp which is renamed to image_to_wbmp. The order of the parameters of all functions whould be unchanged.

Due to the unchanged parameters it should be easyly possible to create wrappers for forward / backward compatiblity to use the new function names in old versions of PHP and via versa.

This was already part of the (inactive?) RFC Consistent Function Names
https://wiki.php.net/rfc/consistent_function_names. But this seems to be too big change for a single RFC.


Step 1:
I create a patch with the new aliases.

Step 2:
Merge the changes with next minor release of PHP 7.x.
Soft deprecation of old function names in the manual.

Step 3:
Deprecated old function names with PHP 8.0.


What is your opinion for this change?
Did you prefer "image_" or "gd_" as a common prefix?


New name                    Old name
image_affine                imageaffine
image_affine_matrix_concat  imageaffinematrixconcat
image_affine_matrix_get     imageaffinematrixget
image_alpha_blending        imagealphablending
image_antialias             imageantialias
image_arc                   imagearc
image_bmp                   imagebmp
image_char                  imagechar
image_char_up               imagecharup
image_color_allocate        imagecolorallocate
image_color_allocate_alpha  imagecolorallocatealpha
image_color_at              imagecolorat
image_color_closest         imagecolorclosest
image_color_closest_alpha   imagecolorclosestalpha
image_color_closest_hwb     imagecolorclosesthwb
image_color_deallocate      imagecolordeallocate
image_color_exact           imagecolorexact
image_color_exact_alpha     imagecolorexactalpha
image_color_match           imagecolormatch
image_color_resolve         imagecolorresolve
image_color_resolve_alpha   imagecolorresolvealpha
image_color_set             imagecolorset
image_color_transparent     imagecolortransparent
image_colors_for_index      imagecolorsforindex
image_colors_total          imagecolorstotal
image_convolution           imageconvolution
image_copy                  imagecopy
image_copy_merge            imagecopymerge
image_copy_merge_gray       imagecopymergegray
image_copy_resampled        imagecopyresampled
image_copy_resized          imagecopyresized
image_create                imagecreate
image_create_from_bmp       imagecreatefrombmp
image_create_from_gd        imagecreatefromgd
image_create_from_gd2       imagecreatefromgd2
image_create_from_gd2_part  imagecreatefromgd2part
image_create_from_gif       imagecreatefromgif
image_create_from_jpeg      imagecreatefromjpeg
image_create_from_png       imagecreatefrompng
image_create_from_string    imagecreatefromstring
image_create_from_wbmp      imagecreatefromwbmp
image_create_from_webp      imagecreatefromwebp
image_create_from_xbm       imagecreatefromxbm
image_create_from_xpm       imagecreatefromxpm
image_create_truecolor      imagecreatetruecolor
image_crop                  imagecrop
image_crop_auto             imagecropauto
image_dashed_line           imagedashedline
image_destroy               imagedestroy
image_ellipse               imageellipse
image_fill                  imagefill
image_fill_to_border        imagefilltoborder
image_filled_arc            imagefilledarc
image_filled_ellipse        imagefilledellipse
image_filled_polygon        imagefilledpolygon
image_filled_rectangle      imagefilledrectangle
image_filter                imagefilter
image_flip                  imageflip
image_font_height           imagefontheight
image_font_width            imagefontwidth
image_ft_bbox               imageftbbox
image_ft_text               imagefttext
image_gamma_correct         imagegammacorrect
image_gd                    imagegd
image_gd2                   imagegd2
image_get_clip              imagegetclip
image_gif                   imagegif
image_grab_screen           imagegrabscreen
image_grab_window           imagegrabwindow
image_interlace             imageinterlace
image_is_truecolor          imageistruecolor
image_jpeg                  imagejpeg
image_layer_effect          imagelayereffect
image_line                  imageline
image_load_font             imageloadfont
image_open_polygon          imageopenpolygon
image_palette_copy          imagepalettecopy
image_palette_to_truecolor  imagepalettetotruecolor
image_png                   imagepng
image_polygon               imagepolygon
image_rectangle             imagerectangle
image_resolution            imageresolution
image_rotate                imagerotate
image_save_alpha            imagesavealpha
image_scale                 imagescale
image_set_brush             imagesetbrush
image_set_clip              imagesetclip
image_set_interpolation     imagesetinterpolation
image_set_pixel             imagesetpixel
image_set_style             imagesetstyle
image_set_thickness         imagesetthickness
image_set_tile              imagesettile
image_string                imagestring
image_string_up             imagestringup
image_sx                    imagesx
image_sy                    imagesy
image_to_wbmp               image2wbmp
image_truecolor_to_palette  imagetruecolortopalette
image_ttf_bbox              imagettfbbox
image_ttf_text              imagettftext
image_types                 imagetypes
image_wbmp                  imagewbmp
image_webp                  imagewebp


Further improvement:

Rename the output functions to image_write_*

New name                    Old name
image_write_bmp             imagebmp
image_write_gd              imagegd
image_write_gd2             imagegd2
image_write_gif             imagegif
image_write_jpeg            imagejpeg
image_write_png             imagepng
image_write_wbmp            imagewbmp
image_write_webp            imagewebp

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to