Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix readme based on 1.0.2 release #131

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ kotlin {
sourceSets {
commonMain {
dependencies {
implementation("media.kamel:kamel-image-default:1.0.0")
implementation("media.kamel:kamel-image-default:$kamel_version")
// no need to specify ktor engines, one is included for each target
// ...
}
Expand All @@ -69,38 +69,35 @@ kotlin {
commonMain {
dependencies {
// core module (required)
implementation("media.kamel:kamel-image:1.0.0")
implementation("media.kamel:kamel-image:$kamel_version")

// Note: When using `kamel-image` a ktor engine is not included.
// To fetch remote images you also must ensure you add your own
// ktor engine for each target.

// optional modules (choose what you need and add them to your kamel config)
implementation("media.kamel:kamel-decoder-image-bitmap:1.0.0")
implementation("media.kamel:kamel-decoder-image-bitmap-resizing:1.0.0") // android only right now
implementation("media.kamel:kamel-decoder-image-vector:1.0.0")
implementation("media.kamel:kamel-decoder-svg-batik:1.0.0")
implementation("media.kamel:kamel-decoder-svg-std:1.0.0")
implementation("media.kamel:kamel-decoder-animated-image:1.0.0")

implementation("media.kamel:kamel-fetcher-resources-jvm:1.0.0")
implementation("media.kamel:kamel-fetcher-resources-android:1.0.0")
implementation("media.kamel:kamel-decoder-image-bitmap:$kamel_version")
implementation("media.kamel:kamel-decoder-image-bitmap-resizing:$kamel_version") // android only right now
implementation("media.kamel:kamel-decoder-image-vector:$kamel_version")
implementation("media.kamel:kamel-decoder-svg-batik:$kamel_version")
implementation("media.kamel:kamel-decoder-svg-std:$kamel_version")
implementation("media.kamel:kamel-decoder-animated-image:$kamel_version")
// ...
}
}

jvmMain {
dependencies {
// optional modules (choose what you need and add them to your kamel config)
implementation("media.kamel:kamel-fetcher-resources-jvm:1.0.0")
implementation("media.kamel:kamel-fetcher-resources-jvm:$kamel_version")
// ...
}
}

androidMain {
dependencies {
// optional modules (choose what you need and add them to your kamel config)
implementation("media.kamel:kamel-fetcher-resources-android:1.0.0")
implementation("media.kamel:kamel-fetcher-resources-android:$kamel_version")
// ...
}
}
Expand Down Expand Up @@ -162,7 +159,7 @@ the `KamelConfig`:

```kotlin
val desktopConfig = KamelConfig {
takeFrom(KamelConfig.Default)
takeFrom(KamelConfig.Core)
// Available only on Desktop.
resourcesFetcher()
// Available only on Desktop.
Expand All @@ -188,7 +185,7 @@ and `resourcesIdMapper` to the `KamelConfig`:
val context: Context = LocalContext.current

val androidConfig = KamelConfig {
takeFrom(KamelConfig.Default)
takeFrom(KamelConfig.Core)
// Available only on Android.
resourcesFetcher(context)
// Available only on Android.
Expand Down Expand Up @@ -297,13 +294,13 @@ KamelImage(

### Configuring Kamel

The default implementation is ```KamelConfig.Default```. If you wish to configure it, you can do it
The default implementation is ```KamelConfig.Core```. If you wish to configure it, you can do it
the following way:

```kotlin
val customKamelConfig = KamelConfig {
// Copies the default implementation if needed
takeFrom(KamelConfig.Default)
takeFrom(KamelConfig.Core)

// Sets the number of images to cache
imageBitmapCacheSize = DefaultCacheSize
Expand Down Expand Up @@ -372,7 +369,7 @@ KamelConfig {
#### Disk cache size (in bytes)

Kamel can create a persistent disk cache for images by implementing ktor's `CacheStorage` feature.
The default config `KamelConfig.Default` installs this feature with a 10 MiB disk cache size.
The default config `KamelConfig.Core` installs this feature with a 10 MiB disk cache size.
The underlying disk cache is based on coil's multiplatform `DiskLruCache` implementation.

```kotlin
Expand Down