Repository navigation
Test that ReactAndroid ships the ExifInterface Fresco needs - #60420
Conversation
Fresco reads a HEIF image's EXIF orientation with `androidx.exifinterface.media.ExifInterface` but does not declare the dependency, so ReactAndroid declares it. Nothing failed if that declaration was removed. Call Fresco's `HeifExifUtil.getOrientation` on a stream with an EXIF orientation tag and expect the orientation back. Without the dependency the call throws `NoClassDefFoundError`, as it does in an app. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Visual regressionNo visual differences at ios: no capture |
|
@javache has imported this pull request. If you are a Meta employee, you can view this in D135308452. |
|
@javache Thanks for importing this. The "Facebook Internal - Linter" check fails here, and its result is visible only inside Meta. The file passes |
zeyap
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
This pull request was successfully merged by @ide in 2df16e5 When will my fix make it into a release? | How to file a pick request? |
|
This pull request was successfully merged by @ide in 2df16e5 When will my fix make it into a release? | How to file a pick request? |
Summary:
#60371 made ReactAndroid depend on
androidx.exifinterface, which Fresco 3.9.0 uses to read a HEIF image's EXIF orientation but does not declare. No test failed if that dependency was removed.The new
HeifExifOrientationTestcalls Fresco'sHeifExifUtil.getOrientation, the method that crashed, on a stream that holds an EXIF orientation tag, and expects that orientation back. It goes through Fresco instead of loading the class by name, so it checks what an app needs: if a later Fresco stops using ExifInterface, the test passes without the dependency.The stream is a JPEG with no image data, the smallest file ExifInterface reads:
HeifExifUtilpasses the stream toExifInterfacewithout checking its format, and parsing a real HEIF goes throughMediaMetadataRetriever, which Robolectric only stubs.Changelog:
[INTERNAL] [ADDED] - Test that ReactAndroid provides the ExifInterface class Fresco uses for HEIF images
Test Plan:
The test passes. With
implementation(libs.androidx.exifinterface)removed fromReactAndroid/build.gradle.ktsit fails as an app did before #60371:ktfmt is clean.