glide icon indicating copy to clipboard operation
glide copied to clipboard

Glide spams ExifInterface logs

Open polson opened this issue 8 years ago • 14 comments

Glide Version: 4.8.0

Integration libraries: OkHttp3

Device/Android Version: Pixel 2 9.0

Issue details / Repro steps / Use case background: When loading images in a list Glide is checking the orientation of the image in ExifInterfaceImageHeaderParser:40 for each image. This uses the android.media.ExifInterface class which appears to do a poor job of parsing Exif data, and as a result spams the logs with warnings for each image.

~~A potential fix is to use the support library ExifInterface class which is much better at parsing EXIF data.~~ Nevermind, the support ExifInterface is just as spammy. Guess I need to take this up with Google.

An example of the logcat output when scrolling through a recyclerview:

2018-10-30 15:19:58.004 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
2018-10-30 15:19:58.017 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42034
2018-10-30 15:19:58.017 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42035
2018-10-30 15:19:58.017 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42036
2018-10-30 15:19:58.017 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
2018-10-30 15:19:58.017 15892-15999/com.philsoft.test I/chatty: uid=10221(com.philsoft.test) glide-disk-cach identical 1 line
2018-10-30 15:19:58.017 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
2018-10-30 15:19:58.024 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42034
2018-10-30 15:19:58.024 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42035
2018-10-30 15:19:58.024 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42036
2018-10-30 15:19:58.024 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
2018-10-30 15:19:58.051 15892-15999/com.philsoft.test I/chatty: uid=10221(com.philsoft.test) glide-disk-cach identical 5 lines
2018-10-30 15:19:58.051 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
2018-10-30 15:19:58.058 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 34864
2018-10-30 15:19:58.058 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42033
2018-10-30 15:19:58.058 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42034
2018-10-30 15:19:58.058 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42036
2018-10-30 15:19:58.058 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
2018-10-30 15:19:58.065 15892-15999/com.philsoft.test I/chatty: uid=10221(com.philsoft.test) glide-disk-cach identical 2 lines
2018-10-30 15:19:58.065 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
2018-10-30 15:19:58.085 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42034
2018-10-30 15:19:58.085 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42035
2018-10-30 15:19:58.085 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42036
2018-10-30 15:19:58.085 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
2018-10-30 15:19:58.085 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 31
2018-10-30 15:19:58.085 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
2018-10-30 15:19:58.085 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
2018-10-30 15:19:58.092 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42034
2018-10-30 15:19:58.092 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42035
2018-10-30 15:19:58.092 15892-15999/com.philsoft.test W/ExifInterface: Skip the tag entry since tag number is not defined: 42036
2018-10-30 15:19:58.092 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
2018-10-30 15:19:58.126 15892-15999/com.philsoft.test I/chatty: uid=10221(com.philsoft.test) glide-disk-cach identical 10 lines
2018-10-30 15:19:58.126 15892-15999/com.philsoft.test W/ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0

In my GlideModule I have a workaround to remove the Exif image header parser which succeeded in removing the log spam.

GlideModule:

    override fun registerComponents(context: Context, glide: Glide, registry: Registry) {
        super.registerComponents(context, glide, registry)

        //Hack to fix Glide outputting tons of log spam with ExifInterface errors
        glide.registry.imageHeaderParsers.removeAll { it is ExifInterfaceImageHeaderParser }
    }

polson avatar Oct 30 '18 20:10 polson

Can confirm, I'm getting the same output on the same version.

GeoffGodwin avatar Nov 05 '18 00:11 GeoffGodwin

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.

stale[bot] avatar Nov 12 '18 00:11 stale[bot]

mark

coopsrc avatar Nov 15 '18 06:11 coopsrc

I'm getting same warn log.

punchdrunker avatar Nov 21 '18 09:11 punchdrunker

Same here

DennyWeinberg avatar Nov 24 '18 12:11 DennyWeinberg

Same here

eranpolo avatar Nov 27 '18 12:11 eranpolo

b/120077644 is the internal issue.

sjudd avatar Nov 27 '18 17:11 sjudd

Closing this since it doesn't appear to be something we can fix in Glide.

sjudd avatar Nov 27 '18 17:11 sjudd

Same here

tao1 avatar Jan 09 '19 00:01 tao1

Same here

rodvar avatar Feb 14 '19 03:02 rodvar

Same here

YassinAJDI avatar Apr 07 '19 15:04 YassinAJDI

Same here

Jadyli avatar Jun 04 '19 16:06 Jadyli

I got the same error on Glide version 4.9.0

XiaLeon avatar Jun 24 '20 04:06 XiaLeon

same for me on version 4.9.0

netineti0 avatar Oct 06 '20 09:10 netineti0