Skip to content

Commit

Permalink
fix: forced dimensions
Browse files Browse the repository at this point in the history
* fix: forced dimensions

* feat: update version
  • Loading branch information
onildoaguiar authored Jun 7, 2020
1 parent dae9a09 commit f5d2ec0
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 59 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,3 @@ jobs:
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "image-thumbnail",
"version": "1.0.8",
"version": "1.0.9",
"description": "Generate an image thumbnail.",
"main": "index.js",
"scripts": {
Expand Down
33 changes: 6 additions & 27 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,8 @@ module.exports = async (source, options) => {
};

const getDimensions = (imageBuffer, percentageOfImage, dimensions) => {
if (typeof dimensions.width != 'undefined' && typeof dimensions.height != 'undefined') {
return { width: dimensions.width, height: dimensions.height };
}

if (typeof dimensions.width != 'undefined' || typeof dimensions.height != 'undefined') {
return mergeDimensions(imageBuffer, dimensions)
return util.removeUndefined(dimensions);
}

const originalDimensions = sizeOf(imageBuffer);
Expand All @@ -126,36 +122,19 @@ const getDimensions = (imageBuffer, percentageOfImage, dimensions) => {
return { width, height };
}

const mergeDimensions = (imageBuffer, dimensions) => {
const originalDimensions = sizeOf(imageBuffer);
let newDimensions = dimensions

if (typeof dimensions.width == 'undefined')
newDimensions = { width: originalDimensions.width, height: dimensions.height };
else if (typeof dimensions.height == 'undefined')
newDimensions = { width: dimensions.width, height: originalDimensions.height };

return newDimensions;
}

const sharpResize = (imageBuffer, dimensions, jpegOptions) => {
return new Promise((resolve, reject) => {
sharp(imageBuffer)
.resize({ width: dimensions.width, height: dimensions.height, withoutEnlargement: true })
.resize({
...dimensions, withoutEnlargement: true, fit: 'contain',
})
.jpeg(jpegOptions ? jpegOptions : { force: false })
.toBuffer((err, data, info) => {
.toBuffer((err, data) => {
if (err) {
reject(err);
} else {
const { format, width, height, size } = info;
const imagePayload = {
format: format,
width: width,
height: height,
size: size,
};
resolve(data);
}
});
});
};
};
5 changes: 5 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ module.exports.streamToBuffer = (stream) => {
resolve(Buffer.concat(buffers));
})
})
}

module.exports.removeUndefined = (dimensions) => {
Object.keys(dimensions).forEach(key => dimensions[key] === undefined && delete dimensions[key]);
return dimensions
}
2 changes: 1 addition & 1 deletion test/_fixtures/thumbnailBase64FromBase64.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"base64": "/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAGAAoDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAYH/8QAHhAAAgICAgMAAAAAAAAAAAAAAQIAEQMEBhITIaH/xAAVAQEBAAAAAAAAAAAAAAAAAAADBP/EABsRAAIBBQAAAAAAAAAAAAAAAAABAgMEESFh/9oADAMBAAIRAxEAPwCV5Xj29TgmAhsJXaLphAsePqhc2KIa+rfJgDEsxZjZPskxEntklDI9bSiuH//Z"
"base64": "/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAGAAoDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAYH/8QAHhAAAgICAgMAAAAAAAAAAAAAAQIAEQMEBiESExT/xAAUAQEAAAAAAAAAAAAAAAAAAAAD/8QAGxEAAQQDAAAAAAAAAAAAAAAAAAECAxEEIXH/2gAMAwEAAhEDEQA/AIPn+r8vDNPM2tptnyo/oy+ALIiAEgki77NUa6ExGIgY6UwaXVcP/9k="
}
2 changes: 1 addition & 1 deletion test/_fixtures/thumbnailBase64FromFilePath.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"base64": "/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCABAAGADASIAAhEBAxEB/8QAHAAAAgIDAQEAAAAAAAAAAAAABQYEBwADCAEC/8QANBAAAQMDAgQFAgQGAwAAAAAAAQIDBAAFEQYhEhMxQQcUIlFhcYEVMlKRCCMzobHBQkPR/8QAGQEAAwEBAQAAAAAAAAAAAAAAAgMEBQAB/8QAJhEAAgIBBAEDBQEAAAAAAAAAAQIAEQMEEiExURMiQQUjcYHh8P/aAAwDAQACEQMRAD8AqtSbs/b7wxEWyuA05wOOIGOLB2IqPabLJWgypDYEUJyCe9D1uz7bxx1KUgYBWj9R+lNOqGrwi0WzzSG2mn0BQS0rZOfest7HAqjOHHUconhC5Pt0SbIlssxlIDiUpySQRkb0CvvhBMYSuTAcjzGQf+s8Kx9jsf3qxPCrUbtw05J05cyFzIjGWFgf1EDt9aXY+oXLbeFRkOEsOKwW1nH2FDZ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05fUuNvKlPFWBHQAeWcbk7+eg7GtzR1vi6R1Iu7xY6nJiStDPNfCkNg7bHAwcHG+9MSXdLRarPIvF8fZkS3EnDYI9uc4Az2qhqaoP16iRVZiA+5y1qK3mxXcrZefakoWHEocbCVJ79QSKxJctyWrjfPE5/l3NEuur3b7y9xxo4Q+lZPMSdlJPYj4oRqqkDiC3cRUOyB1JUqVKbFxvshlMCYLmpQmkjlBPQJrS1De3b1a7dEKGg1GQEpUhOCQOua09BaGOs25yjMDDMZB4lE758VSccmy5MKFa7ewt2Grko7cWD9xHjvWTrL7qdCk6E9XyhAhNsx0NLUkFtKt8D/I1nXVoTbxGacmMxY7jyIwW4QlJUSAVknoBncnbApiXjR0x5CLhDcYTIwA42slKR8p/6ootOm9PIs7SRbIM55tPEpx9kKUoncnfP7UkVlom5mmnFOOIk9SPSzQ0LQkq7xmXYa7bCLqJkNz3SFJHtKgcpWVKx7h560p34Fz0pZoOor/Ht0tBaQBkKKwXE7BaNuIjyD2p3MM6PuVjXYrjEct9vfI40x3FstKUDkZA2G4B6b1neqXp2/rK0xYNmvUFDbLnMCXkKHMIThIJBOMZPbvV9J05C5CKSvX4LFFOj2PBnPMaYxdbfdpEm9PNLKUhppptSkyFcWeFR/twN968/wAOkuG0lEuNMkSQtLLDiweVuU5cBwE53IJPQZqneLjqPQarlpGSzHSObxrSpsOgkge5Cu4IArF0jBnXfUMaEpbrYkL4eJwEIBPx/wACiejYZAy+h+XRrpVpj6Lda/2DtxjKiylNqG3UEdCPNVa6S1N/TsJER2RZdSMOzmmwpTL7QQ2r4Cwo46Hsa54u1vkWq5SYM1ARIjrLawDkZHg9xVCNcCY1YL6jYdX1KlSpUo4qf//Z"
}
2 changes: 1 addition & 1 deletion test/_fixtures/thumbnailBase64FromUri.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"base64": "/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYn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kKKwXE8BaONxHuD2p2x2dH3KxrsVxiOW+3vkb0x3VstKUDkZAOByAenNZ3il4eP6ytEWDZr1BQ2y75gS8gjzCE4SCQTjGT271fSdOQoYRSV6/BYop0ex7Gc8xpjF1t92kSb080vakNNNNqUmQrdnao/pwOa8zbpDhtJRMjTZEkLSyw4sHyuSnLgOAnPJBJ6DNU7xcdR6DVctIyWY6R5u9aVNh0EkD1IV3BAH/VYukYM676hjQlLdb/EL27nAQgE/H+wono2GSmX0PF0a6VaY+i3X9g7cYyostbahx1BHQj3qrXSWpv4dhIiOybLqRh2c02FKZfaCG1fAWFHHQ9jXPF2t8i1XKTBmoCJEdZbWAcjI9j3FUI1wJjVgvmNh1fUqVKlSjip//9k="
}
2 changes: 1 addition & 1 deletion test/_fixtures/thumbnailBufferFromBase64.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"buffer": {"type":"Buffer","data":[255,216,255,219,0,67,0,6,4,5,6,5,4,6,6,5,6,7,7,6,8,10,16,10,10,9,9,10,20,14,15,12,16,23,20,24,24,23,20,22,22,26,29,37,31,26,27,35,28,22,22,32,44,32,35,38,39,41,42,41,25,31,45,48,45,40,48,37,40,41,40,255,219,0,67,1,7,7,7,10,8,10,19,10,10,19,40,26,22,26,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,255,192,0,17,8,0,6,0,10,3,1,34,0,2,17,1,3,17,1,255,196,0,22,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,255,196,0,30,16,0,2,2,2,2,3,0,0,0,0,0,0,0,0,0,0,1,2,0,17,3,4,6,18,19,33,161,255,196,0,21,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,255,196,0,27,17,0,2,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,17,33,97,255,218,0,12,3,1,0,2,17,3,17,0,63,0,149,229,120,246,245,56,38,2,27,9,93,162,233,132,11,30,62,168,92,216,162,26,250,183,201,128,49,44,197,152,217,62,201,49,18,123,100,148,50,61,109,40,174,31,255,217]}
"buffer": {"type":"Buffer","data":[255,216,255,219,0,67,0,6,4,5,6,5,4,6,6,5,6,7,7,6,8,10,16,10,10,9,9,10,20,14,15,12,16,23,20,24,24,23,20,22,22,26,29,37,31,26,27,35,28,22,22,32,44,32,35,38,39,41,42,41,25,31,45,48,45,40,48,37,40,41,40,255,219,0,67,1,7,7,7,10,8,10,19,10,10,19,40,26,22,26,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,255,192,0,17,8,0,6,0,10,3,1,34,0,2,17,1,3,17,1,255,196,0,22,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,255,196,0,30,16,0,2,2,2,2,3,0,0,0,0,0,0,0,0,0,0,1,2,0,17,3,4,6,33,18,19,20,255,196,0,20,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,196,0,27,17,0,1,4,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,17,4,33,113,255,218,0,12,3,1,0,2,17,3,17,0,63,0,131,231,250,191,47,12,211,204,218,218,109,159,42,63,163,47,128,44,136,128,18,9,34,239,179,84,107,161,49,24,136,24,233,76,26,93,87,15,255,217]}
}
Loading

0 comments on commit f5d2ec0

Please sign in to comment.