Skip to content

Commit 050ffd5

Browse files
committed
Fix generation of maxDensity field value in metadata files
1 parent b908175 commit 050ffd5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and 
77

88
## [Unreleased]
99

10+
- The `maxDensity` field in metadata files when `-max-density 1` is specified now gets the correct value instead of the erroneous `null`.
11+
1012
## [3.0.0] — 2024–12–15
1113

1214
### Changed

lib/processRaster.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export async function processRaster (options) {
108108
let isMetaFileExists = await fileExists(metaJsonPath)
109109
let metaData = isMetaFileExists ? await readJsonFile(metaJsonPath) : {}
110110

111-
metaData.maxDensity = Math.max(metaData.maxDensity, originDensity)
111+
metaData.maxDensity = metaData.maxDensity ? Math.max(metaData.maxDensity, originDensity) : originDensity
112112
metaData.formats = Array.from(new Set([...metaData.formats || [], ...formats]))
113113
metaData.sizes = Array.from(new Set([...metaData.sizes || [], ...sizes].sort((a, b) => {
114114
if (!a.breakpoint) return 1

0 commit comments

Comments
 (0)