Skip to content

Commit

Permalink
fixed error message of bad image definition
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Aug 14, 2024
1 parent d0d8133 commit 757735f
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Fixed error message of bad image definition

## 0.2.11 - 2024-08-09

- Fixed and validates input values headerRows and keepWithHeaderRows
4 changes: 4 additions & 0 deletions src/imageMeasure.js
Original file line number Diff line number Diff line change
@@ -35,6 +35,10 @@ ImageMeasure.prototype.measureImage = function (src) {
return src;
}

if (typeof img === 'object') {
throw 'Not supported image definition: ' + JSON.stringify(img);
}

if (fs.existsSync(img)) {
return fs.readFileSync(img);
}

0 comments on commit 757735f

Please sign in to comment.