bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.69k stars 6.13k forks source link

Glide HEIC/HEIF photos orientation issue #4283

Open xjfang opened 4 years ago

xjfang commented 4 years ago

Glide Version: 4.11

Integration libraries: OkHttp3-3.14.4

Device/Android Version: 10

Issue details / Repro steps / Use case background: I have some orientation issues when loading HEIC/HEIF format photos from local content uri (i.g. content://media/external/images/media/183) while Glide could handle loading same format of photos from remote uri without problem. Does anyone here know if this is a known issue? If so, does Glide have a plan to fix that? And is there anyone else facing the same issue?

Glide load line / GlideModule (if any) / list Adapter code (if any):

GlideApp.with(getActivity()).load(localUri).transition(withCrossFade()).diskCacheStrategy(DiskCacheStrategy.NONE);

Layout XML:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include
        layout="@layout/status_view"
        android:id="@+id/image_status_view" />

    <com.alexvasilkov.gestures.views.GestureImageView
        android:id="@+id/image_view"
        android:layout_gravity="center"
        android:gravity="center"
        android:focusable="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</FrameLayout>

Stack trace / LogCat:

paste stack trace and/or log here
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

xxzxxz513 commented 4 years ago

I have met the same problem.Does anyone have idea to fix this?

hanselip commented 4 years ago

@xxzxxz513 try downgrading to version 4.10 as a workaround

sjudd commented 4 years ago

Is anyone able to attach an example file where that reproduces this issue?

hanselip commented 4 years ago

@sjudd Certainly - see attached ZIP containing an example HEIC file

20191107_171759.heic.zip

xjfang commented 4 years ago

I have met the same problem.Does anyone have idea to fix this?

Looks like there is a commit between v4.10 and v4.11 that break the EXIF parser, and it is fixed by a recent commit. @xxzxxz513 So to solve the issue, you can either downgrade to v4.10 or wait for the v4.12 release (I assume you are on v4.11). @sjudd Ideally if we could get v4.12 soon :)

charlie-captain commented 3 years ago

There is another way to fix it . see https://developer.android.com/jetpack/androidx/releases/exifinterface

import androidx.exifinterface:exifinterface:1.3.2.

This will also fix glide, it works for me.

tfrysinger commented 3 years ago

I have done this import in my app, Glide 4.11 is still is not able to process EXIF images properly. Can we get 4.12 released soon?