Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Editor: Handle when image fails to load #7971

Closed
gwwar opened this issue Sep 8, 2016 · 6 comments
Closed

Image Editor: Handle when image fails to load #7971

gwwar opened this issue Sep 8, 2016 · 6 comments
Assignees
Labels
[Feature] Media The media screen in Calypso, general media management, or integration with third party media. [Feature] Post/Page Editor The editor for editing posts and pages. [Type] Task
Milestone

Comments

@gwwar
Copy link
Contributor

gwwar commented Sep 8, 2016

If an image fails to load in the editor we should display an error notice that lets the user know what happened.

Common error cases would be:

  1. Image never finishes loading
  2. Image is supposed to have CORS headers but doesn't. Which taints the canvas.
  3. Drawing the image to canvas fails

We can simulate the errors by throwing them locally in the image editor functions.

To enable the image editor:

  1. Navigate to http://calypso.localhost:3000/post
  2. Select a site
  3. Add an image
  4. Select the image
    screen shot 2016-08-09 at 2 12 35 pm
  5. Click "Edit", then click on "Edit Image" in the top right corner of the detail view
    screen shot 2016-08-09 at 2 12 43 pm
  6. The image editor should load.
    screen shot 2016-08-09 at 2 12 58 pm
@gwwar gwwar added [Feature] Post/Page Editor The editor for editing posts and pages. [Type] Task [Feature] Media The media screen in Calypso, general media management, or integration with third party media. labels Sep 8, 2016
@gwwar gwwar added this to the Image Editor milestone Sep 8, 2016
@retrofox retrofox assigned retrofox and unassigned obenland Sep 8, 2016
@retrofox
Copy link
Contributor

retrofox commented Sep 8, 2016

In some way we will avoid a bit more this situation once merged #7977. Let's implement it anyway.

@retrofox
Copy link
Contributor

retrofox commented Sep 8, 2016

We have a z-index issue here when we wanna show a global error and the image editor modal at the same time. Pay attention to the red global error:

image

Beyond of the discussion if we should swap the level of both elements and how to do it (model and error global notice) in this case I suggest hide the modal and show the global error because doesn't make sense show the modal there since the user won't can edit the image in any way.

@gwwar
Copy link
Contributor Author

gwwar commented Sep 8, 2016

I would suggest navigating back to the media detail view, which you should be able to get to by calling: this.props.onImageEditorCancel

@retrofox
Copy link
Contributor

retrofox commented Sep 8, 2016

I was thinking to add an onLoadError to canvas component.

@gwwar
Copy link
Contributor Author

gwwar commented Sep 8, 2016

Sorry @retrofox let's use an inline notice over a global one. We already do this in the media modal for other validation errors

@gwwar
Copy link
Contributor Author

gwwar commented Sep 12, 2016

Closed by @retrofox in #8002

@gwwar gwwar closed this as completed Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media The media screen in Calypso, general media management, or integration with third party media. [Feature] Post/Page Editor The editor for editing posts and pages. [Type] Task
Projects
None yet
Development

No branches or pull requests

3 participants