Revert "Introduce a new "Old Image Formats" rule"

This commit is contained in:
Gaël Métais
2023-08-12 04:07:03 +02:00
committed by GitHub
parent 599d02ea0e
commit 773249ca4f
14 changed files with 164 additions and 396 deletions
+10 -5
View File
@@ -86,10 +86,6 @@ describe('redownload', function() {
data.toolsResults.redownload.offenders.imageOptimization.totalGain.should.be.above(0);
data.toolsResults.redownload.offenders.imageOptimization.images.length.should.equal(2);
data.toolsResults.redownload.offenders.should.have.a.property('oldImageFormats');
data.toolsResults.redownload.offenders.oldImageFormats.totalGain.should.be.above(0);
data.toolsResults.redownload.offenders.oldImageFormats.images.length.should.equal(1);
data.toolsResults.redownload.offenders.should.have.a.property('imagesTooLarge');
data.toolsResults.redownload.offenders.imagesTooLarge.length.should.equal(0);
@@ -171,9 +167,18 @@ describe('redownload', function() {
redownload.redownloadEntry(entry)
.then(function(newEntry) {
newEntry.weightCheck.bodySize.should.equal(4193);
newEntry.weightCheck.bodyBuffer.should.deep.equal(fileContent);
done();
// Opening the image in jimp to check if the format is good
var Jimp = require('jimp');
Jimp.read(newEntry.weightCheck.bodyBuffer, function(err, image) {
image.bitmap.width.should.equal(620);
image.bitmap.height.should.equal(104);
done(err);
});
})
.fail(function(err) {