alexk111 / ngImgCrop

Image Crop directive for AngularJS (THIS PROJECT IS NOT MAINTAINED ANYMORE)
MIT License
1.12k stars 515 forks source link

Use image onload event to fix image load issue #108

Closed markthiessen closed 2 years ago

markthiessen commented 9 years ago

Loading images will occasionally fail - you can't guarantee that the image is loaded before calling other code that depends on the image being present if you just set the src property and carry on.

This fix uses the onload event to ensure that the image is actually loaded before proceeding.