camera-preview icon indicating copy to clipboard operation
camera-preview copied to clipboard

Image size should be added to image response

Open mrSingh007 opened this issue 4 years ago • 5 comments

As plugin not returning image size, we can not control uploaded images size to app. We want to restrict user from uploading big size images. Obviously there is 'quality' config attribute but it's not about image size.

Describe the solution you'd like Either on image response the image size should be returned aswell, so that on frontend size check can be done. Or On config it should be possible to add max image size and plugin should check the image size.

The "exif" data can contain image size Information. (Image size in KB )

mrSingh007 avatar Nov 19 '20 12:11 mrSingh007

Hi, @mrSingh007 did you refer to image file size? or image dimensions?

arielhernandezmusa avatar Dec 07 '20 00:12 arielhernandezmusa

i mean image file size. in KB or MB

mrSingh007 avatar Dec 07 '20 10:12 mrSingh007

You can calculate de image size from the base 64 result

arielhernandezmusa avatar Dec 09 '20 11:12 arielhernandezmusa

yes, I can but then have to write the plugin again thats why I created this ticket for this feature.

mrSingh007 avatar Dec 10 '20 21:12 mrSingh007

You don’t need to write the plug-in, take a look at this post https://softwareengineering.stackexchange.com/questions/288670/know-file-size-with-a-base64-string, you can calculate the file size from the base64 returned by the plug-in.

But also I’ll add the feature you requested

arielhernandezmusa avatar Dec 10 '20 22:12 arielhernandezmusa