-
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.
Merge pull request #821 from agokhale/pdf-noncompliant
Pdf noncompliant
- Loading branch information
Showing
5 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
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
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
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,10 @@ | ||
//issues/820 | ||
|
||
module.exports = exports = {}; | ||
exports.isNuisance = function(instring) { | ||
//console.log ("wat", instring.toString(), typeof(instring)); | ||
// scan each emitted line, if it's an error line, remove it | ||
//**** Error: stream operator isn't terminated by valid EOL. | ||
if( instring.toString().indexOf ("**** Error: stream operator isn't terminated by valid EOL.") > 1) { return 1 } | ||
return 0 ; | ||
} |
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,20 @@ | ||
'use strict'; | ||
|
||
//https://github.com/aheckmann/gm/issues/820 | ||
var assert = require('assert'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
|
||
module.exports = function (_, dir, finish, gm) { | ||
if (!gm.integration) return finish(); | ||
|
||
var imagePath = path.join(__dirname, './fixtures/synthetic_invalid.pdf'); | ||
var inputStream = fs.createReadStream(imagePath); | ||
gm(inputStream) | ||
.size({ bufferStream: true }, function(err, size) { | ||
if (err) return finish(err); | ||
assert.equal(612, size.width); | ||
assert.equal(792, size.height); | ||
finish(); | ||
}); | ||
} |