-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ added testcase for corrupted pdf (parses correctly thanks to filena…
…me hint)
- Loading branch information
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const assert = require('assert'); | ||
const path = require('path'); | ||
const fs = require('fs') | ||
|
||
module.exports = function (_, dir, finish, gm, imageMagick) { | ||
if (!gm.integration) return finish(); | ||
|
||
var imagePath = path.join(__dirname, 'fixtures', 'test.pdf'); | ||
var inputStream = fs.createReadStream(imagePath); | ||
gm(inputStream, 'test.pdf').options({ imageMagick }).identify('%p', function(err, value) { | ||
if (err) return finish(err); | ||
assert.equal(value, '1'); | ||
finish(); | ||
}); | ||
} |