miguelbcr / RxPaparazzo

RxJava extension for Android to take images using camera and gallery and pick files up
Apache License 2.0
466 stars 53 forks source link

Crash/exception when using size option #49

Closed hemb closed 7 years ago

hemb commented 7 years ago

When picking an image from the gallery, some images throw an IOException when using the size option, e.g. RxPaparazzo.takeImage(activity).usingGallery().size(new CustomMaxSize(500));

java.lang.RuntimeException: java.io.IOException: Invalid marker
    at rx.exceptions.Exceptions.propagate(Exceptions.java:58)
    at com.fuck_boilerplate.rx_paparazzo.interactors.ImageUtils.copyExifRotation(ImageUtils.java:260)
    ...
Caused by: java.io.IOException: Invalid marker
    at android.media.ExifInterface.saveJpegAttributes(ExifInterface.java:1961)
    at android.media.ExifInterface.saveAttributes(ExifInterface.java:1604)
   at com.fuck_boilerplate.rx_paparazzo.interactors.ImageUtils.copyExifRotation(ImageUtils.java:256)

Looks like they had the same problem in the uCrop library. https://github.com/Yalantis/uCrop/issues/184

miguelbcr commented 7 years ago

Hi @hemb, thanks for the issue, it seems to be related with non JPG images and ExifInterface.saveAttributes(), which only supports JPG files

Try version 0.3.2 out and let me know if it works

hemb commented 7 years ago

@miguelbcr Yes, fixed in 0.3.2. Thanks!