Skip to content Skip to sidebar Skip to footer

Fine Uploader - Get Width & Height Dimensions Once Image Is Selected/uploaded

Using fine-uploader i need to be able to get the selected file's original width and height dimensions in pixels so that i can use them for later use on my page. Is there a way to d

Solution 1:

Fine Uploader doesn't provide this type of data, but it's simple to determine the dimensions of an image yourself. First, convert the image file to an object URL (URL.createObjectURL(file)) then use that URL as the src attribute of an img element. Finally, after the <img> has completely rendered, check the width and height properties of the element. Fine Uploader does this internally when it is asked to validate an image file based on specific dimension limits. See the image validation code for an example.


Post a Comment for "Fine Uploader - Get Width & Height Dimensions Once Image Is Selected/uploaded"