flutter / flutter/flutter

Cannot decode JPEG on flutter web

Open
#151,273 10 comments 10 reactions 0 assignees View on GitHub
a: images browser: chrome-desktop c: rendering e: web_canvaskit e: web_skwasm engine found in release: 3.22 found in release: 3.23 has reproducible steps P2 platform-web team-web triaged-web
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

1. Download and build the project available [here](https://github.com/sgehrman/jpeg_bug).
2. Build and run the project on desktop, mobile and web.
3. The JPEG image located at `jpeg_bug/assets/badJpeg.jpg` renders fine on desktop and mobile, but shows as a black rectangle on web (Chrome).

### Expected results

The JPEG image at path `jpeg_bug/assets/badJpeg.jpg` in [this](https://github.com/sgehrman/jpeg_bug) project should render normally in a web application.

### Actual results

The JPEG image at path `jpeg_bug/assets/badJpeg.jpg` in [this](https://github.com/sgehrman/jpeg_bug) project should renders as a black rectangle.

### Code sample

Code available [here](https://github.com/sgehrman/jpeg_bug).

### Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

### Logs

Logs

```console
[Paste your logs here]
```

### Flutter Doctor output

Doctor output

```console
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.6 23G5052d darwin-arm64, locale en-US)
• Flutter version 3.22.2 on channel stable at /Users/milke/Developer/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 761747bfc5 (4 weeks ago), 2024-06-05 22:15:13 +0200
• Engine revision edd8546116
• Dart version 3.4.3
• DevTools version 2.34.3

[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.15.0

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.6 23G5052d darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.6 23G5052d darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.127

[✓] Network resources
• All expected network resources are available.

! Doctor found issues in 2 categories.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.