mapbox / mapbox/mapbox-gl-js

Could not load image because of The source image could not be decoded Error when adding WMTS layer

Open
#11,465 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**: 2.6.1

**browser**: Chrome v 97.0.4692.99

### Steps to Trigger Behavior
add WMTS layer to map as "raster" (using NOAA imagery in example)

### Link to Demonstration
https://codepen.io/sanidhya-pratap-singh/pen/JjOKpqV

### Expected Behavior
All tiles should be rendered

### Actual Behavior
All tiles are not rendered correctly. Tiles are missing altogether or showing old image from lower zoom level. Constant error in browser console

`Error: Could not load image because of The source image could not be decoded.. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`

![Screenshot 2022-02-03 at 4 44 18 PM](https://user-images.githubusercontent.com/10533379/152337289-d151df8c-6155-427f-b5af-5bd4a8895752.png)

![Screenshot 2022-02-03 at 5 20 07 PM](https://user-images.githubusercontent.com/10533379/152337461-afa1fc7d-56cd-4b7a-8e28-b3875a0aacd6.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodePen and reproduce the NOAA WMTS raster layer in Chrome, using the browser console to confirm the image-decoding error and the missing or stale tiles. Trace the WMTS raster tile-loading path from that configuration; done means all expected tiles render correctly without decode errors or lower-zoom fallbacks.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.