Editor node.js - Get height and with of img file
Editor node.js - Get height and with of img file
Is there a way to get height and width of a uploaded img file? I want to validate height x width geometric.
.validator(
Validate.fileExtensions(
['png', 'jpg'],
'Only image files can be uploaded (png and jpg)'
)
)
.validator( file => {
console.log('file:');
console.log(file);
return true;
})
console:
{ uuid: 'fsdfe20sdfsdf1',
field: 'upload',
file: '/tmp/express-busboy/fsdfe20sdfsdf1/upload/logo.jpg',
filename: 'logo.jpg',
encoding: '7bit',
mimetype: 'image/jpeg',
truncated: 'false',
done: 'true',
size: 16453,
extn: 'jpg',
name: 'logo' }
This discussion has been closed.
Answers
This node package should do the job nicely.
Allan