Glide spams ExifInterface logs
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 }
}
Can confirm, I'm getting the same output on the same version.
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.
mark
I'm getting same warn log.
Same here
Same here
b/120077644 is the internal issue.
Closing this since it doesn't appear to be something we can fix in Glide.
Same here
Same here
Same here
Same here
I got the same error on Glide version 4.9.0
same for me on version 4.9.0