[wp-trac] [WordPress Trac] #59782: PHP deprecation error in WP_Image_Editor_Imagick
WordPress Trac
noreply at wordpress.org
Wed Nov 1 07:21:05 UTC 2023
#59782: PHP deprecation error in WP_Image_Editor_Imagick
-------------------------------+-----------------------------
Reporter: skithund | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.5
Severity: normal | Keywords:
Focuses: php-compatibility |
-------------------------------+-----------------------------
When cropping and saving an image it throws an deprecation error when
`WP_Image_Editor_Imagick` is [https://php.watch/versions/8.1/deprecate-
implicit-conversion-incompatible-float-string converting floats to ints].
`Implicit conversion from float 1112.7466666666667 to int loses precision`
Backtrace originally in JSON format from our central logging, hence funny
formatting:
{{{#!json
{
"file": "/srv/www/site/public_html/wp-admin/admin-ajax.php",
"line": 188,
"function": "do_action",
"args": [
"wp_ajax_image-editor"
]
},
{
"file": "/srv/www/site/public_html/wp-includes/plugin.php",
"line": 517,
"function": "do_action",
"class": "WP_Hook",
"object": {
"callbacks": {
"1": {
"wp_ajax_image_editor": {
"function": "wp_ajax_image_editor",
"accepted_args": 1
}
}
}
},
"type": "->",
"args": [
[
""
]
]
},
{
"file": "/srv/www/site/public_html/wp-includes/class-wp-hook.php",
"line": 334,
"function": "apply_filters",
"class": "WP_Hook",
"object": {
"callbacks": {
"1": {
"wp_ajax_image_editor": {
"function": "wp_ajax_image_editor",
"accepted_args": 1
}
}
}
},
"type": "->",
"args": [
"",
[
""
]
]
},
{
"file": "/srv/www/site/public_html/wp-includes/class-wp-hook.php",
"line": 310,
"function": "wp_ajax_image_editor",
"args": [
""
]
},
{
"file": "/srv/www/site/public_html/wp-admin/includes/ajax-actions.php",
"line": 2683,
"function": "wp_save_image",
"args": [
4281
]
},
{
"file": "/srv/www/site/public_html/wp-admin/includes/image-edit.php",
"line": 930,
"function": "image_edit_apply_changes",
"args": [
{},
[
{
"type": "crop",
"sel": {
"x": 0,
"y": 45,
"w": 475,
"h": 326
}
}
]
]
},
{
"file": "/srv/www/site/public_html/wp-admin/includes/image-edit.php",
"line": 722,
"function": "crop",
"class": "WP_Image_Editor_Imagick",
"object": {},
"type": "->",
"args": [
0,
153.60000000000002,
1621.3333333333335,
1112.7466666666667
]
},
{
"file": "/srv/www/site/public_html/wp-includes/class-wp-image-editor-
imagick.php",
"line": 606,
"function": "setImagePage",
"class": "Imagick",
"object": {},
"type": "->",
"args": [
1621.3333333333335,
1112.7466666666667,
0,
0
]
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59782>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list