WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#18723 closed defect (bug) (fixed)

Image Editing does not handle failures gracefully

Reported by: westi Owned by: azaozz
Milestone: 3.3 Priority: normal
Severity: major Version: 3.2
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

The Image Editing tools in the admin do not handle failures gracefully.

For example if loading an image / rotating and image fails and returns a failure instead of an image you end up with a spinning wheel of failure.

To reproduce:

  • Upload an image
  • Choose to edit it to get to the crop, rotate, resize options.
  • Edit 'stream_preview_image' in 'wp-admin/includes/image-edit.php' to always return false.
  • Now try an rotation. Notice the spinner never stops spinning.

This is because the javascript doesn't register an 'error' handler on the img but only a load handler so when WP fails to return an image we don't handle the error gracefully.

Change History (2)

comment:1 westi3 years ago

We need at least something like:

		img.error( function() {
			alert( 'Sorry, something went wrong.' );
			t.toggleEditor(postid, 0);
		} )

in refreshEditor

comment:2 azaozz3 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In [18798]:

Add error message when loading the preview image in the image editor fails, fixes #18723

Note: See TracTickets for help on using tickets.