cstefanache / angular2-img-cropper

Angular 2 Image Cropper
MIT License
364 stars 135 forks source link

Some images are not displayed after file selection. #236

Open KingLoui99 opened 6 years ago

KingLoui99 commented 6 years ago

Hello Cornel Thx for that great project. We use it and feel fine with it, but have some problems with some images. I select the file (jpg) and the display area of the image keeps blank / gray. Do i save the same image with paint it works fine. But the image seems to be ok, because i can open it in any image program and browser. I added a sample image which does not work.

Loui 20170105test unbenannt

murilobd commented 6 years ago

I have this issue too in Safari!

marcus29200 commented 6 years ago

I was running into a similar problem, basically what I ended up doing was this:

image.onload = function() { that.cropper.setImage(image); }

I had to do this because when the cropper loaded the image, the image wasn't fully loaded yet. After doing this, I havn't had any problems with images no showing.

KingLoui99 commented 6 years ago

Hello again OK that does not solve our problem but maybe someone can help me. We found out the following error..

vendor.bundle.js:49694 ERROR RangeError: Offset is outside the bounds of the DataView at DataView.getUint16 () at Function.webpackJsonp.../../../../ng2-img-cropper/src/exif.js.Exif.readTags (vendor.bundle.js:2960) at Function.webpackJsonp.../../../../ng2-img-cropper/src/exif.js.Exif.readEXIFData (vendor.bundle.js:3105) at Function.webpackJsonp.../../../../ng2-img-cropper/src/exif.js.Exif.findEXIFinJPEG (vendor.bundle.js:2887) at handleBinaryFile (vendor.bundle.js:2816) at Function.webpackJsonp.../../../../ng2-img-cropper/src/exif.js.Exif.getImageData (vendor.bundle.js:2827) at Function.webpackJsonp.../../../../ng2-img-cropper/src/exif.js.Exif.getData (vendor.bundle.js:3163) at ImageCropperComponent.webpackJsonp.../../../../ng2-img-cropper/src/imageCropperComponent.js.ImageCropperComponent.getOrientedImage (vendor.bundle.js:4713) at vendor.bundle.js:4673 at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (polyfills.bundle.js:6551)

--> Somone understand what's going wrong?

marcus29200 commented 6 years ago

I had this problem once, and it went away after reinitializing the cropper (re-loading the page). And I haven't had it since.