Update tests for format inference

master
Alexandre Durrive 9 years ago
parent bfa8a5595c
commit b39e32ba2f
  1. 1
      .gitignore
  2. BIN
      examples/imgs/icon.ico
  3. 21
      test/formatInference.js
  4. 3
      test/gifFrameStream.js
  5. 2
      test/resizeAndAutoOrientFromBuffer.js
  6. 2
      test/resizeBuffer.js
  7. 3
      test/streamerr.js

1
.gitignore vendored

@ -9,5 +9,6 @@ examples/imgs/*
!examples/imgs/photo.JPG
!examples/imgs/orientation/*\d.jpg
!examples/imgs/orientation/*.correct.jpg
!examples/imgs/icon.ico
*.sw*
.idea

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

@ -0,0 +1,21 @@
var assert = require('assert')
var fs = require('fs');
module.exports = function (_, dir, finish, gm) {
var m = gm(fs.createReadStream(dir + '/icon.ico'), 'icon.ico')
var args = m.args();
assert.equal('convert', args[0]);
assert.equal('ico:-', args[1]);
if (!gm.integration)
return finish();
m
.size({bufferStream: true}, function (err, size) {
if (err) return finish(err);
assert.equal(128, size.width);
assert.equal(128, size.height);
finish();
});
}

@ -1,4 +1,3 @@
var assert = require('assert')
var fs = require('fs');
@ -7,7 +6,7 @@ module.exports = function (_, dir, finish, gm) {
var args = m.args();
assert.equal('convert', args[0]);
assert.equal('-[0]', args[1]);
assert.equal('gif:-[0]', args[1]);
if (!gm.integration)
return finish();

@ -14,7 +14,7 @@ module.exports = function (_, dir, finish, gm) {
var args = m.args();
assert.equal('convert', args[0]);
assert.equal('-', args[1]);
assert.equal('jpg:-', args[1]);
assert.equal('-resize', args[2]);
if (m._options.imageMagick) {
assert.equal('20%', args[3]);

@ -13,7 +13,7 @@ module.exports = function (_, dir, finish, gm) {
var args = m.args();
assert.equal('convert', args[0]);
assert.equal('-', args[1]);
assert.equal('jpg:-', args[1]);
assert.equal('-resize', args[2]);
if (m._options.imageMagick) {
assert.equal('48%', args[3]);

@ -7,8 +7,7 @@ module.exports = function (_, dir, finish, gm) {
// The following invocation should fail, because 'convert'
// has no way of interpreting the file.
gm(
svg_file,
'./test.svg' // fiction
svg_file
).options({
imageMagick: true
}).setFormat('png').toBuffer(function(err, buffer) {

Loading…
Cancel
Save