Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/source/raster_dem_tile_worker_source.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {DEMData} from '../data/dem_data';
import {RGBAImage} from '../util/image';
import type {Actor} from '../util/actor';
import {AJAXError} from '../util/ajax';
import type {
WorkerDEMTileParameters,
TileParameters
Expand All @@ -17,6 +18,10 @@

async loadTile(params: WorkerDEMTileParameters): Promise<DEMData | null> {
const {uid, encoding, rawImageData, redFactor, greenFactor, blueFactor, baseShift} = params;
if (rawImageData.width === 1) {
// 1x1 images should not be loaded. They are meant to cache tiles without content (204).
throw new AJAXError(404, 'not found', '', new Blob());
}

Check warning on line 24 in src/source/raster_dem_tile_worker_source.ts

View check run for this annotation

Codecov / codecov/patch

src/source/raster_dem_tile_worker_source.ts#L23-L24

Added lines #L23 - L24 were not covered by tests
const width = rawImageData.width + 2;
const height = rawImageData.height + 2;
const imagePixels: RGBAImage | ImageData = isImageBitmap(rawImageData) ?
Expand Down
Loading