[wp-trac] [WordPress Trac] #54009: Image upload fails with ambiguous error.

WordPress Trac noreply at wordpress.org
Wed Aug 25 20:13:23 UTC 2021


#54009: Image upload fails with ambiguous error.
--------------------------+---------------------
 Reporter:  quantumzen    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.9
Component:  Media         |     Version:  5.8
 Severity:  normal        |  Resolution:
 Keywords:  php8          |     Focuses:
--------------------------+---------------------
Changes (by SergeyBiryukov):

 * keywords:   => php8
 * milestone:  Awaiting Review => 5.9


Old description:

> Error message:
> ''Post-processing of the image failed likely because the server is busy
> or does not have enough resources. Uploading a smaller image may help.
> Suggested maximum size is 2500 pixels.''
>
> ajax error content:
>   Fatal error:  Uncaught TypeError: round(): Argument #1 ($num) must be
> of type int|float,
>   string given in C:\***\wp-admin\includes\image.php:844
>   Stack trace:
>   #0 C:\***\wp-admin\includes\image.php(844): round()
>   #1 C:\***\wp-admin\includes\media.php(380): wp_read_image_metadata()
>   #2 C:\***\wp-admin\includes\ajax-actions.php(2549):
> media_handle_upload()
>   #3 C:\***\wp-admin\async-upload.php(33): wp_ajax_upload_attachment()
>   #4 {main} thrown in C:\***\wp-admin\includes\image.php on line 844
>
> line 844:
> {{{
> $meta['aperture'] = round( wp_exif_frac2dec( $exif['FNumber'] ), 2 );
> }}}
>
> Images with a meta > camera > aperture of 0 seem to cause this error.
> An aperture value of 0 can occur if the camera is using a manual lens
> with no connector pins, for example an adapted vintage lens.

New description:

 Error message:
 ''Post-processing of the image failed likely because the server is busy or
 does not have enough resources. Uploading a smaller image may help.
 Suggested maximum size is 2500 pixels.''

 ajax error content:
 {{{
   Fatal error:  Uncaught TypeError: round(): Argument #1 ($num) must be of
 type int|float,
   string given in C:\***\wp-admin\includes\image.php:844
   Stack trace:
   #0 C:\***\wp-admin\includes\image.php(844): round()
   #1 C:\***\wp-admin\includes\media.php(380): wp_read_image_metadata()
   #2 C:\***\wp-admin\includes\ajax-actions.php(2549):
 media_handle_upload()
   #3 C:\***\wp-admin\async-upload.php(33): wp_ajax_upload_attachment()
   #4 {main} thrown in C:\***\wp-admin\includes\image.php on line 844
 }}}
 line 844:
 {{{
 $meta['aperture'] = round( wp_exif_frac2dec( $exif['FNumber'] ), 2 );
 }}}

 Images with a meta > camera > aperture of 0 seem to cause this error.
 An aperture value of 0 can occur if the camera is using a manual lens with
 no connector pins, for example an adapted vintage lens.

--

Comment:

 This seems related to PHP 8.0, adding the keyword.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54009#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list