Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Dec 9, 2020

Description

  • Change the implementation of skiaInstantiateWebImageCodec to use the lower-level XHR API that can distinguish between HTTP errors and non-HTTP error (e.g. CORS).
  • Make all image-related errors ImageCodecException.
  • Use custom error messages for HTTP errors, non-HTTP XHR errors, and codec errors. In particular, when encountering a non-HTTP XHR error, direct the user to the page that elaborates on CORS and other nuances of image loading on the web (this is the best we can do as the browser does not report whether an error is CORS or something else).

This PR should land after flutter/website#5061 because it refers to the web page that's being added in that PR.

Related Issues

Fixes flutter/flutter#71619.

Tests

Added new tests in canvaskit/image_test.dart.

@chinmaygarde chinmaygarde added the platform-web Code specifically for the web engine label Dec 10, 2020
Copy link
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yjbanov yjbanov merged commit d0b6e42 into flutter:master Dec 14, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 15, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 15, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 15, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 15, 2020
gspencergoog pushed a commit to gspencergoog/engine that referenced this pull request Jan 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] CanvasKit throws cryptic error when failing to load a CORS image

4 participants