Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / image / AGENTS.md
| 1 | # AGENTS.md — library/image/ (':library:image') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/image/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | <!-- last-reviewed: 2026-10-16 --> |
| 6 | - Gradle: :library:image / dir: library/image/ |
| 7 | - Package roots present: (image loading pipeline — `image/` + `compose/`/`decoders/`/`fetchers/`/`util/` subpackages) |
| 8 | - Entry files: ImageLoader.kt + compose/AsyncImage.kt (no MainActivity/Route — library) |
| 9 | - Deps: (none — permission-free by design, #884) |
| 10 | - Network: this module loads local data only; network apps opt into HTTP(S) by |
| 11 | handing `ImageLoader.Builder.remote()` a fetch function they build from |
| 12 | `NetworkClient` — no library-to-library edge either way |
| 13 | - Metadata: metadata_data/library-image.md (absent — libraries have none by design) |
| 14 | - Rust: no / screenshotTest: no |
| 15 | |
| 16 | ## Overview |
| 17 | **Purpose:** Shared image pipeline — requests, memory/disk caches, fetchers (http/asset/file/content/bitmap/byte-array), bitmap/SVG/video-frame decoders, Compose `AsyncImage` + animated images, Coil compat shim. |
| 18 | **How to use:** `AsyncImage` in Compose with an `ImageRequest`; custom sources add a `fetchers/Fetcher`; transforms via `Transformation`; percent sizing via `util/PercentSizing`. |
| 19 | **Entry points:** `ImageLoader.kt` → `ImageRequest.kt` → `compose/AsyncImage.kt`. |
| 20 | **Gotchas:** `coilcompat/` is a migration shim, not a target — new code uses this pipeline directly. Cache keys must include transformations or stale variants render. |
| 21 | |
| 22 | ## Key files |
| 23 | - com/vayunmathur/library/image/ImageLoader.kt |
| 24 | - com/vayunmathur/library/image/ImageRequest.kt |
| 25 | - com/vayunmathur/library/image/ImageResult.kt |
| 26 | - com/vayunmathur/library/image/MemoryCache.kt |
| 27 | - com/vayunmathur/library/image/DiskCache.kt |
| 28 | - com/vayunmathur/library/image/Transformation.kt |
| 29 | - com/vayunmathur/library/image/Size.kt |
| 30 | - com/vayunmathur/library/image/compose/AsyncImage.kt |
| 31 | - com/vayunmathur/library/image/compose/AsyncImageState.kt |
| 32 | - com/vayunmathur/library/image/compose/AnimatedImage.kt |
| 33 | - com/vayunmathur/library/image/coilcompat/CoilCompat.kt — migration shim, not a target |
| 34 | - com/vayunmathur/library/image/decoders/BitmapDecoder.kt |
| 35 | - com/vayunmathur/library/image/decoders/SvgDecoder.kt |
| 36 | - com/vayunmathur/library/image/decoders/VideoFrameDecoder.kt |
| 37 | - com/vayunmathur/library/image/fetchers/Fetcher.kt |
| 38 | - com/vayunmathur/library/image/fetchers/AssetFetcher.kt |
| 39 | - com/vayunmathur/library/image/fetchers/FileFetcher.kt |
| 40 | - com/vayunmathur/library/image/fetchers/ContentResolverFetcher.kt |
| 41 | - com/vayunmathur/library/image/fetchers/BitmapFetcher.kt |
| 42 | - com/vayunmathur/library/image/fetchers/ByteArrayFetcher.kt |
| 43 | - com/vayunmathur/library/image/util/PercentSizing.kt |
| 44 | - com/vayunmathur/library/image/util/Sha256.kt |
| 45 | |
| 46 | ## Verify (this module only) |
| 47 | ``` |
| 48 | ./gradlew :library:image:compileDevKotlin |
| 49 | ./gradlew :library:image:lint |
| 50 | ``` |