Skip to content

Commit

Permalink
Fix generation of maxDensity field value in metadata files
Browse files Browse the repository at this point in the history
  • Loading branch information
firefoxic committed Dec 25, 2024
1 parent b908175 commit 1c338f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and 

## [Unreleased]

### Fixed

- The `maxDensity` field in metadata files when `-max-density 1` is specified now gets the correct value instead of the erroneous `null`.

## [3.0.0] — 2024–12–15

### Changed
Expand Down
2 changes: 1 addition & 1 deletion lib/processRaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export async function processRaster (options) {
let isMetaFileExists = await fileExists(metaJsonPath)
let metaData = isMetaFileExists ? await readJsonFile(metaJsonPath) : {}

metaData.maxDensity = Math.max(metaData.maxDensity, originDensity)
metaData.maxDensity = metaData.maxDensity ? Math.max(metaData.maxDensity, originDensity) : originDensity
metaData.formats = Array.from(new Set([...metaData.formats || [], ...formats]))
metaData.sizes = Array.from(new Set([...metaData.sizes || [], ...sizes].sort((a, b) => {
if (!a.breakpoint) return 1
Expand Down

0 comments on commit 1c338f4

Please sign in to comment.