We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86b8d06 commit 106f263Copy full SHA for 106f263
scripts/updateData.js
@@ -235,12 +235,12 @@ const addImageMetadata = async (sponsors) => {
235
const {image} = sponsor;
236
if(!image) return;
237
try {
238
- const {width, height} = await sharp('.' + image).metadata();
+ const {width, height, format} = await sharp('.' + image).metadata();
239
240
sponsor.imageWidth = width;
241
sponsor.imageHeight = height;
242
sponsor.isWideImage = sponsor.showCaption === undefined && width > height * 1.8;
243
- sponsor.imageType = path.extname(image).toLowerCase().slice(1);
+ sponsor.imageType = format;
244
} catch(err) {
245
console.log(`Error while reading image metadata [${image}]: ${err}`);
246
}
0 commit comments