Skip to content

Commit

Permalink
✅ added testcase for corrupted pdf (parses correctly thanks to filena…
Browse files Browse the repository at this point in the history
…me hint)
  • Loading branch information
poison committed Oct 1, 2024
1 parent 9608ab6 commit c11a967
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Binary file added test/fixtures/test.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions test/pdf.js
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();
});
}

0 comments on commit c11a967

Please sign in to comment.