Skip to content

Commit

Permalink
gm engine: Map &progressive to .interlace('line')
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Mar 14, 2016
1 parent 07da482 commit 3aac4db
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/getFilterInfosAndTargetContentTypeFromQueryString.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ module.exports = function getFilterInfosAndTargetContentTypeFromQueryString(quer
}[String(gmOperation.args[0]).toLowerCase()] || 'Center'
];
}
if (gmOperation.name === 'progressive') {
gmOperation.name = 'interlace';
gmOperation.args = [ 'line' ];
}
if (!gmInstance[gmOperation.name]) {
gmOperation = _.extend({}, gmOperation);
gmOperation.args.unshift(gmOperation.name);
Expand Down
18 changes: 18 additions & 0 deletions test/processImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,24 @@ describe('express-processimage', function () {
.and('to resemble', pathModule.resolve(__dirname, '..', 'testdata', 'rotatedBulb.gif'))
});
});

it('should support generating a progressive (interlaced) GIF', function () {
config.debug = true;
return expect('GET /bulb.gif?rotate=90&progressive', 'to yield response', {
headers: {
'X-Express-Processimage': 'gm'
},
body: expect.it('to have metadata satisfying', {
format: 'GIF',
size: {
width: 48,
height: 48
},
Interlace: 'Line'
})
.and('to resemble', pathModule.resolve(__dirname, '..', 'testdata', 'rotatedBulb.gif'))
});
});
});

describe('with gifsicle available', function () {
Expand Down

0 comments on commit 3aac4db

Please sign in to comment.