How to get selected image size


#1

Hi everyone!

What i do :
I use @ionic-native/camera to get images from device.

What i want :
I want to resize/scale image on client, before send it to server.

Problem :
But camer.getPicture() function return string which define a path to image in my photo library/albums.

I know about cameraOptions and targetWidth/Height properties. But it useles for my situation, because there can be images with different width and height, so i can`t set all them one size.

Question:
Is there some way to change image size/scale if i have link to image, maybe someone knows some plugin , that can fetch image by link and change it based on current image size?
Thx.


#2

See: Any image editing plugin/library available for Ionic 3?


#3

thx you very much!!!


#4

Hi everyone. I found solution inside @ionic-native/camera.
i thougth that targetWidth and targetHeight will set to image size that i define, but it will scale your image based on values that you define, so your image will be normal)))
Thx everyone!