1

I'm on a NodeJS server running parse server and I send from my iOS app, the UIImageJPEGRepresentation of an image, to a cloud function call. What I want, is to retrieve the image dimensions, from my cloud function...

I've searched and searched, but without any luck!

Any ideas?

Sotiris Kaniras
  • 520
  • 1
  • 12
  • 30
  • [You can take a look at this link.](https://stackoverflow.com/questions/67345903/how-do-i-get-the-size-of-an-image-represented-as-a-unit8array) to achieve your purpose – Quoc Dat Mar 27 '23 at 07:42

1 Answers1

1

Look at this: https://www.npmjs.com/package/image-size This lib can calculate the image dimensions:

var sizeOf = require('image-size');
sizeOf('images/funny-cats.png', function (err, dimensions) {
  console.log(dimensions.width, dimensions.height);
});
sarkiroka
  • 1,485
  • 20
  • 28
  • Thanks for answering! What I need to do is use the data - `base64` - I already have and get the dimensions... Any idea how to do that? – Sotiris Kaniras Nov 16 '18 at 20:47