Below is a simple code that requires "image-size" module Nodejs, in the variable "sizeOf" and calls it along with the parameter as the image name in its current directory. Then it prints that image's width and height. I need to know in what unit it measures the image.
const sizeOf = require('image-size');
(async () => {
dimensions = sizeOf("photo.jpg")
console.log("width: ", dimensions.width,"height: ", dimensions.height)
})();
Output= width: 192 height: 612 Dimension in a file folder for photo.jpg= width: 750 pixels height: 750 pixels
CodePudding user response:
The unit is actually in pixels because an image is also measured in pixels.