vue-clip icon indicating copy to clipboard operation
vue-clip copied to clipboard

Height and Width are not working

Open misterjacket opened this issue 7 years ago • 3 comments

image

As you can see the ''Height'' and ''Width'' are undefined. I tried this with jpeg and png files.

Anyone have a solution?

misterjacket avatar May 19 '17 13:05 misterjacket

can someone help me !?

misterjacket avatar May 23 '17 07:05 misterjacket

When the file is added, a new File object is created from the native file interface object that dropzone passes vue-clip. See here for the event handler: https://github.com/thetutlage/vue-clip/blob/master/src/components/Clip/index.js#L224-L239. See here for the File constructor: https://github.com/thetutlage/vue-clip/blob/master/src/File.js#L5-L20.

If I remember right from my own debugging, I usually see the width & height empty when no dataUrl is returned (large files, unsupported file types, etc), but you show it present here. It may be important to note that the width & height are not updated on progress, just when the file is added.

alexsasharegan avatar May 23 '17 13:05 alexsasharegan

I had the exact same problem. However, I found a solution. You can check the files[0]._file.width & files[0]._file.height . Those variables holds the data ;)

Morgitou avatar Jan 26 '18 10:01 Morgitou