feat(phase-1/m4.4e): real JVM EXIF orientation normalizer

The §6.3 EXIF row deferred implementation to "M4+ when the JVM
attachment intake lands" — it landed in M4.4c, so the last NoOp
placeholder is gone. JvmImageOrientationNormalizer keeps the Android
contract exactly: orientation 6/3/8 -> bake 90/180/270 into pixels,
re-encode JPEG @ 0.92, return input UNCHANGED for normal/absent/mirror
tags or any decode/rotate failure.

Tooling differs, contract doesn't: com.drewnoakes:metadata-extractor
2.19.0 (first Central pull this phase — recorded) for the tag read,
BufferedImage + AffineTransform for the rotate, ImageIO JPEG writer at
explicit 0.92 for the encode. DesktopContainer now wires it into
NoteRepositoryImpl (was ImageOrientationNormalizer.NoOp).

New probe: :core:data-jvm:orientationSmoke hand-builds an
EXIF-Orientation-90 JPEG (APP1 splice — metadata-extractor is
read-only) and asserts: no-EXIF passthrough, EXIF-90 rewrite, pixels
rotated (4x2 -> 2x4), output stability, garbage passthrough.

Verified: :core:data-jvm:orientationSmoke (RESULT: M4.4e PASS, 5/5)
+ ./gradlew assembleDebug :desktopApp:build SUCCESSFUL
+ :desktopApp:run --self-test (SELFTEST id=1 -> RENDER notes=1
selected=1); objectbox-models clean.
This commit is contained in:
Incido Developer committed 2026-10-06 19:04:09 +13:00
1 parent 018db4819c
commit 0dc5935d1d
5 files changed
+207 -2

No files matched your search

@@ -15,7 +15,7 @@ import org.incido.compose.di.AppGraph
import org.incido.compose.di.EncryptionBadge
import org.incido.compose.di.LibraryVerification
import kotlinx.coroutines.flow.map
import org.incido.data.ImageOrientationNormalizer
import org.incido.data.jvm.JvmImageOrientationNormalizer
import org.incido.data.ObjectBoxStore
import org.incido.data.crypto.AesGcmFieldCipher
import org.incido.data.crypto.CipherHolder
@@ -81,7 +81,10 @@ class DesktopContainer(val dataDir: File) : AppGraph {
override val noteRepository: NoteRepository = NoteRepositoryImpl(
boxStore = boxStore,
cipherHolder = cipherHolder,
orientationNormalizer = ImageOrientationNormalizer.NoOp,
// M4.4e: real EXIF orientation on desktop too (metadata-extractor
// + BufferedImage) — the last NoOp placeholder is gone; see
// JvmImageOrientationNormalizer for the Android-contract mapping.
orientationNormalizer = JvmImageOrientationNormalizer(),
)
/** Migration sweep + startup integrity checker — the shared service. */