WordPress.org

Make WordPress Core

Opened 7 weeks ago

Last modified 7 weeks ago

#54009 new defect (bug)

Image upload fails with ambiguous error.

Reported by: quantumzen Owned by:
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.8
Component: Media Keywords: php8
Focuses: Cc:

Description (last modified by SergeyBiryukov)

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.

Attachments (2)

photo-meta-example.PNG (24.8 KB) - added by quantumzen 7 weeks ago.
Sugarloaf Mountain.jpg (45.2 KB) - added by quantumzen 7 weeks ago.

Download all attachments as: .zip

Change History (5)

#1 follow-up: @adamsilverstein
7 weeks ago

Hi @quantumzen thanks for the detailed bug report. Can you provide a sample image that causes the error? That way we can reproduce the issue and test out proposed fixes.

#2 @SergeyBiryukov
7 weeks ago

  • Description modified (diff)
  • Keywords php8 added
  • Milestone changed from Awaiting Review to 5.9

Hi there, welcome to WordPress Trac! Thanks for the report.

This seems related to PHP 8.0, adding the keyword.

Last edited 7 weeks ago by SergeyBiryukov (previous) (diff)

#3 in reply to: ↑ 1 @quantumzen
7 weeks ago

@adamsilverstein No problem. Please see the new attachment.

Note: See TracTickets for help on using tickets.