Status Update
Comments
an...@gmail.com <an...@gmail.com> #2
Looking at the exiftool data, it reports Orientation = 6, which is rotated 90 degrees counter-clockwise and needs 90 degrees clockwise rotation to appear correct. Of course, it's unusual that a Google format would be correct in exiftool and not in Google's own ExifInterface library. I see it's also not handling the rotation as I would expect in Chrome.
exiftool -V ~/Downloads/676x380.webp
ExifToolVersion = 12.60
FileName = 676x380.webp Dog\ Yule\ Log.mp4 Lil\ Bub\ Video\ Yule\ Log.mp4 android-studio-2022.2.1.19-mac_arm.dmg gradle.properties simpsons_background.png
Directory = /Users/clee/Downloads
FileSize = 116812
FileModifyDate = 1683650274
FileAccessDate = 1683655195
FileInodeChangeDate = 1683654924
FilePermissions = 33188
FileType = WEBP
FileTypeExtension = WEBP
MIMEType = image/webp
FileType [override] = Extended WEBP
FileTypeExtension [override] = WEBP
RIFF 'VP8X' chunk (10 bytes of data):
VP8X (SubDirectory) -->
+ [BinaryData directory, 10 bytes]
| WebP_Flags = 8
| ImageWidth = 2063598243
| ImageHeight = 97024
RIFF 'VP8 ' chunk (53444 bytes of data):
VP8Bitstream (SubDirectory) -->
+ [BinaryData directory, 53444 bytes]
| VP8Version = 0
| ImageWidth = 676
| HorizontalScale = 0
| ImageHeight = 380
| VerticalScale = 0
RIFF 'EXIF' chunk (63321 bytes of data):
Warning = [minor] Improper EXIF header
EXIF (SubDirectory) -->
+ [TIFF directory]
| ExifByteOrder = II
| + [IFD0 directory with 12 entries]
| | 0) ImageWidth = 4000
| | 1) ImageHeight = 3000
| | 2) Make = samsung
| | 3) Model = SM-S908U1
| | 4) Orientation = 6
| | 5) XResolution = 72 (72/1)
| | 6) YResolution = 72 (72/1)
| | 7) ResolutionUnit = 2
| | 8) Software = S908U1UES2CWCC
| | 9) ModifyDate = 2023:04:22 09:15:37
| | 10) YCbCrPositioning = 1
| | 11) ExifOffset (SubDirectory) -->
| | + [ExifIFD directory with 30 entries]
| | | 0) ExposureTime = 0.03333333333 (1/30)
| | | 1) FNumber = 2.2 (220/100)
| | | 2) ExposureProgram = 2
| | | 3) ISO = 400
| | | 4) ExifVersion = 0220
| | | 5) DateTimeOriginal = 2023:04:22 09:15:37
| | | 6) CreateDate = 2023:04:22 09:15:37
| | | 7) OffsetTime = -05:00
| | | 8) OffsetTimeOriginal = -05:00
| | | 9) ShutterSpeedValue = 0.03333333333 (1/30)
| | | 10) ApertureValue = 2.27 (227/100)
| | | 11) BrightnessValue = 0.21 (21/100)
| | | 12) ExposureCompensation = 0 (0/100)
| | | 13) MaxApertureValue = 2.27 (227/100)
| | | 14) MeteringMode = 2
| | | 15) Flash = 0
| | | 16) FocalLength = 2.2 (220/100)
| | | 17) SubSecTime = 960
| | | 18) SubSecTimeOriginal = 960
| | | 19) SubSecTimeDigitized = 960
| | | 20) FlashpixVersion = 0100
| | | 21) ColorSpace = 1
| | | 22) ExifImageWidth = 676
| | | 23) ExifImageHeight = 380
| | | 24) ExposureMode = 0
| | | 25) WhiteBalance = 0
| | | 26) DigitalZoomRatio = 1 (100/100)
| | | 27) FocalLengthIn35mmFormat = 13
| | | 28) SceneCaptureType = 0
| | | 29) ImageUniqueID = DA8XLOD01SM
| + [IFD1 directory with 8 entries]
| | 0) ImageWidth = 512
| | 1) ImageHeight = 384
| | 2) Compression = 6
| | 3) XResolution = 72 (72/1)
| | 4) YResolution = 72 (72/1)
| | 5) ResolutionUnit = 2
| | 6) ThumbnailOffset = 852
| | 7) ThumbnailLength = 62463
ra...@google.com <ra...@google.com>
[Deleted User] <[Deleted User]> #3
For context, I found this because I got a bug report about a similar issue with an upside down photo on a Samsung Galaxy S10 and managed to reproduce the problem as a sideways WEBP on an S22 Ultra. I can supply more pictures from different Samsung models exhibiting this same problem if that would be useful.
gh...@google.com <gh...@google.com> #4
Will anyone please take a look at this bug? It appears on many, very common devices and results in mis-rotated images.
an...@gmail.com <an...@gmail.com> #5
Hi,
I can confirm there is an issue with the WebP exif reading implementation. I ran into the same issue when retrieving WebP images from the Amazon's Serverless Image Handler. Initially I thought it was a bug in the library I'm using (Coil) but found out it wasn't the case.
I have a bugfix available for the issue and am preparing a PR (that will be submitted via Gerrit).
Validated with my own images (a yellow sticky note captured at all 4 orientations) + the one from the google repo + the one from the topic starter.
Note: The bottom left image is a google webp without exif, the bottom right image is a google webp with exif
Note 2: It's also broken in Chrome & Firefox but works correctly on Safari/Finder on MacOS. I might submit bugfixes for those too.
tn...@google.com <tn...@google.com> #6
an...@gmail.com <an...@gmail.com> #8
Thanks for the detailed investigation! I've replied on the PR with more details - but I'm not sure this image is a valid WebP.
wo...@gmail.com <wo...@gmail.com> #9
Branch: androidx-main
commit 161d43d41357f5d34fe7907c82ed9fca0b04d57a
Author: Laurence Muller <laurence.muller@gmail.com>
Date: Fri Dec 22 14:38:22 2023
Fix attribute reader for WebP images with Exif App1 Sections
The current attribute reader for WebP images fails to read the attributes if the Exif metadata contains an Exif App1 Section. The reason is that the byte-order is specified after the Exif App1 Section marker in the Exif payload. This patch will check if the Exif App1 section is present and correct the payload accordingly. This will allow it to read the Exif metadata (such as image orientation) correctly.
Test: Added a new image to cover this use case with a test. Run the instrument test using: ./gradlew :exifinterface:exifinterface:connectedAndroidTest
Fixes:
Change-Id: Idbb14e9fbcb038616ce650da03ed1d7eb9f997a5
M exifinterface/exifinterface/src/androidTest/java/androidx/exifinterface/media/ExifInterfaceTest.java
A exifinterface/exifinterface/src/androidTest/res/raw/invalid_webp_with_jpeg_app1_marker.webp
M exifinterface/exifinterface/src/androidTest/res/values/arrays.xml
M exifinterface/exifinterface/src/main/java/androidx/exifinterface/media/ExifInterface.java
wo...@gmail.com <wo...@gmail.com> #10
Hi, since this issue is now fixed in the codebase, is there any timeline on when this will be rolled out via a minor update (e.g v1.3.8)?
Would love to be able to use Exifinterface without having to use local workarounds in my apps.
di...@gmail.com <di...@gmail.com> #11
This will be included in 1.4.0, likely released sometime in Q2 - I'm afraid we won't be doing a 1.3.8 release as the current exifinterface
release branch is too old and we need to snap it to a more recent version from androidx-main
.
wo...@gmail.com <wo...@gmail.com> #12
Branch: androidx-main
commit fd3fee5a3ef4d40a3a35a869b7bfb2399e63e814
Author: Ian Baker <ibaker@google.com>
Date: Tue Feb 20 18:16:04 2024
Add comment for test added in
Test: ExifInterfaceTest
Bug: 281638358
Change-Id: Ied3650ee5d2bf290556c86ad546c3e28bd2f8d8a
M exifinterface/exifinterface/src/androidTest/java/androidx/exifinterface/media/ExifInterfaceTest.java
[Deleted User] <[Deleted User]> #13
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.exifinterface:exifinterface:1.4.0-alpha01
[Deleted User] <[Deleted User]> #14
We have checkDependencies=true
on our app module and apply there custom lint checks. Disabling custom lint checks has not solved the issue, though we have more custom lint checks via external dependencies (for example, timber).
an...@gmail.com <an...@gmail.com> #15
#14, could you check with checkDependencies=false
? It fixes problem on my project. Would be nice to hear more proves.
[Deleted User] <[Deleted User]> #16
#15, I've set checkDependencies = false
, but left our custom lint checks enabled. So far lint finished successfully without issue errors.
an...@gmail.com <an...@gmail.com> #17
In my case, all builds of the >50 were a success after checkDependencies = false
. However, disabling checkDependencies
is not a solution as well. Since all our code is split in small logical modules, there is no point in lint. Too many false-positives and true-negatives.
gh...@google.com <gh...@google.com> #18
I cherry-picked a change to 4.1 Beta 4 which essentially changes this error into a logged warning rather than a hard failure. That does not "fix" the problem, but it at least gets us back to the behavior of 3.6. Can someone confirm that this workaround has worked for them?
Also, I think I know what the root cause is (see notes below). However, it's hard to be sure without a repro scenario. Would anyone be willing to share an open-source project that reproduces this bug? (You can also send the project to
Notes:
-
My current theory is that this bug is related to
.https://issuetracker.google.com/159733104#comment6
I.e., I think Lint should not be reusing the same Kotlin compiler environment to analyze multiple modules, which is what we do whencheckDependencies=true
. -
It is still strange that the failure is nondeterministic. However, one potential reason is that the Kotlin compiler caches many things via
SoftReference
.
an...@gmail.com <an...@gmail.com> #19
Sorry for my long delay. I was tried with 4.1.0-beta05
(newest version to date), and the problem is still here. I added new log in case lines were changed.
Would anyone be willing to share an open-source project that reproduces this bug?
I have only closed source project with this problem. Maybe someone knows some quite large multimodule opensource project I could try setup AGP with lint and try reproduction?
an...@gmail.com <an...@gmail.com> #20
I tried to reproduce with two small multimodule projects, but all builds works flawlessly. Also, I tried to reproduce using checkDependencies
, and 6 other helper modules. 145k CLOC without tests. I suppose there is a good chance problem happen due to the cache.
It is still strange that the failure is nondeterministic.
It is even non-deterministic in CI/docker builds using the same fresh environment and exactly the same code each time. Build cache and daemon is disabled there. Multithreading should be involved as well.
In addition, I found in most cases failed due to the same file
br...@google.com <br...@google.com> #21
gh...@google.com <gh...@google.com> #22
There are some architectural changes coming in Lint that will fix this properly, but they will not make it into 4.2.
However, there is another workaround you can try that will be available starting in AGP 4.2 Beta 4.
Essentially you can tell Lint to "reset" the Kotlin compiler between each module analysis, thereby clearing all caches. I did not make this the default behavior because the effect on performance is unknown/risky.
To enable this behavior, either set the environment variable LINT_DO_NOT_REUSE_UAST_ENV
to "true", or set the JVM system property lint.do.not.reuse.uast.env
to "true". For example, you can do this from the command line:
./gradlew -Dlint.do.not.reuse.uast.env=true :app:lintDebug
Or by putting this in your gradle.properties
file:
systemProp.lint.do.not.reuse.uast.env=true
gh...@google.com <gh...@google.com> #23
Status updates:
-
I'm still hoping someone can confirm whether the workaround in
worked for them in AGP 4.2.comment#22 -
Starting with AGP 7.0-alpha13 the root cause of this issue should be fixed completely due to the new "partial analysis" mode (enabled by default) in which Lint analyzes modules independently and merges results along the way. It fixes the issue because Lint will no longer use the same Kotlin compiler environment to analyze multiple modules (and so the risk of stale caches is gone).
ws...@gmail.com <ws...@gmail.com> #24
I'm still hoping someone can confirm whether the workaround in
worked for them in AGP 4.2. comment#22
This unfortunately did not work for us. We actually see lint crashes after enabling via systemProp.lint.do.not.reuse.uast.env=true
. See the attached log. It's also much slower, as expected.
AGP 4.2 seems to make this error much more frequent compared to 4.1, for some reason.
gh...@google.com <gh...@google.com> #25
Can you file a new bug? You can add a comment here linking to it.
ws...@gmail.com <ws...@gmail.com> #26
Sure. Without that workaround, we get the same
ERROR: package fragment is not found for module:<lint-module> is a module[ModuleDescriptorImpl@5e5e6c61] file:KtFile: LiveViewerViewData.kt
error in this ticket occasionally (1-2% of the time?).
gh...@google.com <gh...@google.com> #27
Oh, I misunderstood. So, using lint.do.not.reuse.uast.env
is what causes the new crash? That is unfortunate, and I will investigate. Let me know if there is a sample project you can share that reproduces the issue.
ws...@gmail.com <ws...@gmail.com> #28
Not sure if you still wanted the new bug, but here it is:
gh...@google.com <gh...@google.com> #29
FYI the issue in
And to confirm, lint.do.not.reuse.uast.env
should no longer be needed at all in AGP 7.0+.
ku...@gmail.com <ku...@gmail.com> #30
Thanks #29 . I am noticing that when this happens, after the error log for
package fragment is not found for module:<lintWithKotlin> is a module
There is another error
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'descriptor' of org/jetbrains/kotlin/codegen/context/CodegenContext.intoPackagePart must not be null
at org.jetbrains.kotlin.codegen.context.CodegenContext.$$$reportNull$$$0(CodegenContext.java)
at org.jetbrains.kotlin.codegen.context.CodegenContext.intoPackagePart(CodegenContext.java)
at org.jetbrains.kotlin.asJava.builder.LightClassDataProviderForClassOrObject$computeLightClassData$1$1.invoke(LightClassDataProvider.kt:51)
at org.jetbrains.kotlin.asJava.builder.LightClassDataProviderForClassOrObject$computeLightClassData$1$1.invoke(LightClassDataProvider.kt:38)
at org.jetbrains.kotlin.asJava.builder.LightClassBuilderKt.buildLightClass(LightClassBuilder.kt:64)
at org.jetbrains.kotlin.asJava.builder.LightClassDataProviderForClassOrObject$computeLightClassData$1.invoke(LightClassDataProvider.kt:47)
at org.jetbrains.kotlin.asJava.builder.LightClassDataProviderForClassOrObject$computeLightClassData$1.invoke(LightClassDataProvider.kt:38)
at org.jetbrains.kotlin.cli.jvm.compiler.CliLightClassGenerationSupport.createDataHolderForClass(CliLightClassGenerationSupport.kt:64)
at org.jetbrains.kotlin.asJava.builder.LightClassDataProviderForClassOrObject.computeLightClassData(LightClassDataProvider.kt:45)
at org.jetbrains.kotlin.asJava.builder.LightClassDataProviderForClassOrObject.compute(LightClassDataProvider.kt:61)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:235)
at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:113)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:72)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:236)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
at
Does the fix address both of these?
gh...@google.com <gh...@google.com> #31
package fragment is not found
and Argument for @NotNull parameter...
), the workaround in 4.2 is to put
systemProp.lint.do.not.reuse.uast.env=true
in your gradle.properties
file as described in
gh...@google.com <gh...@google.com> #32
Marking fixed in AGP 7.0.
That is, the lint.do.not.reuse.uast.env
workaround should no longer be needed in AGP 7.0+. And, you should no longer see the following warnings/errors while running Lint:
ERROR: package fragment is not found for module:<lintWithKotlin>...
ERROR: Could not generate LightClass for...
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'descriptor' of org/jetbrains/kotlin/codegen/context/CodegenContext.intoPackagePart must not be null
The issue is fixed due to the new "Lint partial analysis" mode (enabled by default) which creates a standalone UastEnvironment
instance for each module, thereby avoiding stale caches in the Kotlin compiler frontend.
Please comment on the bug if you see any similar errors in AGP 7.0+.
Description
AGP: 4.0.0 Kotlin: 1.3.72 JVM: from docker image: 8u252-jdk-slim
Failure happens in CI builds, which always are clean. Failures are random. Sometimes builds are a success, but more often it is not. Each time random classes failed. For example, in this case, failed this little data class:
I included full stacktrace as file