Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
main ▾

Modern-Apps.git / library / image / AGENTS.md

AGENTS.md2.8 KiBRenderedCodeRaw
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- Gradle: :library:image / dir: library/image/
6- Package roots present: (image loading pipeline — `image/` + `compose/`/`decoders/`/`fetchers/`/`util/` subpackages)
7- Entry files: ImageLoader.kt + compose/AsyncImage.kt (no MainActivity/Route — library)
8- Deps: (none — permission-free by design)
9- Network: this module loads local data only; network apps opt into HTTP(S) by
10 handing `ImageLoader.Builder.remote()` a fetch function they build from
11 `NetworkClient` — no library-to-library edge either way
12- Metadata: metadata_data/library-image.md (absent — libraries have none by design)
13- Rust: no / screenshotTest: no
14
15## Overview
16**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.
17**How to use:** `AsyncImage` in Compose with an `ImageRequest`; custom sources add a `fetchers/Fetcher`; transforms via `Transformation`; percent sizing via `util/PercentSizing`.
18**Entry points:** `ImageLoader.kt` → `ImageRequest.kt` → `compose/AsyncImage.kt`.
19**Gotchas:** `coilcompat/` is a Coil compat shim, not a target for new code — new code uses this pipeline directly. Cache keys must include transformations or stale variants render.
20
21## Key files
22- com/vayunmathur/library/image/ImageLoader.kt
23- com/vayunmathur/library/image/ImageRequest.kt
24- com/vayunmathur/library/image/ImageResult.kt
25- com/vayunmathur/library/image/MemoryCache.kt
26- com/vayunmathur/library/image/DiskCache.kt
27- com/vayunmathur/library/image/Transformation.kt
28- com/vayunmathur/library/image/Size.kt
29- com/vayunmathur/library/image/compose/AsyncImage.kt
30- com/vayunmathur/library/image/compose/AsyncImageState.kt
31- com/vayunmathur/library/image/compose/AnimatedImage.kt
32- com/vayunmathur/library/image/coilcompat/CoilCompat.kt — Coil compat shim, not a target for new code
33- com/vayunmathur/library/image/decoders/BitmapDecoder.kt
34- com/vayunmathur/library/image/decoders/SvgDecoder.kt
35- com/vayunmathur/library/image/decoders/VideoFrameDecoder.kt
36- com/vayunmathur/library/image/fetchers/Fetcher.kt
37- com/vayunmathur/library/image/fetchers/AssetFetcher.kt
38- com/vayunmathur/library/image/fetchers/FileFetcher.kt
39- com/vayunmathur/library/image/fetchers/ContentResolverFetcher.kt
40- com/vayunmathur/library/image/fetchers/BitmapFetcher.kt
41- com/vayunmathur/library/image/fetchers/ByteArrayFetcher.kt
42- com/vayunmathur/library/image/util/PercentSizing.kt
43- com/vayunmathur/library/image/util/Sha256.kt
44
45## Verify (this module only)
46```
47./gradlew :library:image:compileDevKotlin
48./gradlew :library:image:lint
49```