Image upload
Image upload
How do I check the height and width of the original image that is being uploaded please? What ever I have tried doesn't work. It needs to be at least 400px wide and 460px in height or the preview gets stretched
- reader.readAsDataURL(this.files[0]);
- this.files = (this.height);
-
- $( '#cropimage' ).on('load', function() {
- var image = $(this),
- cropwidth = image.attr('cropwidth'),
- cropheight = image.attr('cropheight'),
- results = image.next('.results' );
-
- image.cropbox( {width: cropwidth, height: cropheight, showControls: 'auto' } )
- .on('cropbox', function( event, results, img ) {
-
- $("#theHiddenX").val ( results.cropX );
- $("#theHiddenY").val ( results.cropY );
- $("#theHiddenW").val ( results.cropW );
- $("#theHiddenH").val ( results.cropH );
-
- });
-
- } );