0

We have image path like

cdvfile://localhost/persistent/DCIM/Camera/1395167011485.jpg.

OR

file://localhost/persistent/DCIM/Camera/1395167011485.jpg.

We need get image details using this path.Image details like Image Name,height, width.We are developing Cordova mobile apps.Please guide to us .Which plugin we need use for Details.

Pavan Alapati
  • 635
  • 2
  • 8
  • 21

2 Answers2

2

You don't need a specific plugin, though you could use file transfer to help with it. Something like the following will work fine:

var image = document.createElement('img');
image.src = "img/My_Image.png";
console.log(image.height);
console.log(image.width);
Kody R.
  • 2,430
  • 5
  • 22
  • 42
1

You might find this javascript exif library useful.

Bob
  • 1,589
  • 17
  • 25
  • Thanks for reply I flowed this https://github.com/guilhermefarias/cordova-exif Yes we can get Image Details but problem is We are getting only JPG images only We need to get PNG image also – Pavan Alapati Apr 12 '17 at 15:04
  • (Good to know about the plugin) Seems exif not applied to png. Don't have an answer for you. However, did just find a a node package jsgui-node-png-metadata which you might get something out of if the code is in js or even C++ if you used emscripten on it. – Bob Apr 12 '17 at 15:33