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




  1. reader.readAsDataURL(this.files[0]);
  2.                 this.files = (this.height);
  3.            
  4.                 $( '#cropimage' ).on('load', function() { 
  5.                     var image = $(this),
  6.                     cropwidth = image.attr('cropwidth'),
  7.                     cropheight = image.attr('cropheight'),               
  8.                     results = image.next('.results' );   
  9.                                
  10.                         image.cropbox( {width: cropwidth, height: cropheight, showControls: 'auto' } )
  11.                         .on('cropbox', function( event, results, img ) {
  12.                                                                    
  13.                             $("#theHiddenX").val ( results.cropX );
  14.                             $("#theHiddenY").val ( results.cropY );
  15.                             $("#theHiddenW").val ( results.cropW );
  16.                             $("#theHiddenH").val ( results.cropH );         
  17.                              
  18.                         });
  19.                    
  20.                 } );   
    • Topic Participants

    • info