Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17.0.15+6'
- name: Select XCode 16.3
java-version: '17.0.16+8'
- name: Select XCode 16.4
run: |
sudo xcode-select -s /Applications/Xcode_16.3.app/Contents/Developer
sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
xcodebuild -version
- name: Gradle Cache
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ of Ashampoo Photo Organizer, which, in turn, is driven by user community feedbac
## Installation

```
implementation("com.ashampoo:kim:0.25")
implementation("com.ashampoo:kim:0.26")
```

For the targets `wasmJs` & `js` you also need to specify this:
Expand Down
64 changes: 34 additions & 30 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework

plugins {
kotlin("multiplatform") version "2.2.0"
id("com.android.library") version "8.9.3"
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.library)
id("signing")
id("io.gitlab.arturbosch.detekt") version "1.23.8"
id("org.jetbrains.kotlinx.kover") version "0.9.1"
id("com.asarkar.gradle.build-time-tracker") version "5.0.1"
id("me.qoomon.git-versioning") version "6.4.4"
id("com.goncalossilva.resources") version "0.10.0"
id("com.github.ben-manes.versions") version "0.52.0"
id("com.vanniktech.maven.publish") version "0.34.0"
alias(libs.plugins.detekt)
alias(libs.plugins.kover)
alias(libs.plugins.build.time.tracker)
alias(libs.plugins.git.versioning)
alias(libs.plugins.resources)
alias(libs.plugins.versions)
alias(libs.plugins.maven.publish)
}

repositories {
Expand All @@ -23,11 +23,6 @@ repositories {

val productName: String = "Ashampoo Kim"

val ktorVersion: String = "3.2.1"
val xmpCoreVersion: String = "1.5.2"
val dateTimeVersion: String = "0.7.1"
val kotlinxIoVersion: String = "0.8.0"

description = productName
group = "com.ashampoo"
version = "0.0.0"
Expand Down Expand Up @@ -70,7 +65,7 @@ kover {
}

dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.8")
detektPlugins(libs.detekt.formatting)
}

kotlin {
Expand Down Expand Up @@ -142,10 +137,10 @@ kotlin {
dependencies {

/* Date handling */
implementation("org.jetbrains.kotlinx:kotlinx-datetime:$dateTimeVersion")
implementation(libs.kotlinx.datetime)

/* XMP handling */
api("com.ashampoo:xmpcore:$xmpCoreVersion")
api(libs.xmpcore)
}
}

Expand All @@ -156,7 +151,7 @@ kotlin {
/* Kotlin Test */
implementation(kotlin("test"))

implementation("org.jetbrains.kotlinx:kotlinx-io-core:$kotlinxIoVersion")
implementation(libs.kotlinx.io.core)
}
}

Expand Down Expand Up @@ -202,14 +197,14 @@ kotlin {
*
* Not available in commonMain due to missing WASM support.
*/
api("io.ktor:ktor-io:$ktorVersion")
api(libs.ktor.io)

/*
* Multiplatform file access
*
* Not available in commonMain due to missing JS browser support.
*/
api("org.jetbrains.kotlinx:kotlinx-io-core:$kotlinxIoVersion")
api(libs.kotlinx.io.core)
}
}

Expand Down Expand Up @@ -309,9 +304,9 @@ kotlin {

dependencies {

implementation("org.jetbrains.kotlinx:kotlinx-browser:0.3")
implementation(libs.kotlinx.browser)

implementation(npm("pako", "2.1.0"))
implementation(npm("pako", libs.versions.pako.get()))
}
}
}
Expand All @@ -331,13 +326,13 @@ android {

namespace = "com.ashampoo.kim"

// For API 35 tests fail. Something seems incompatible.
compileSdk = 34
compileSdk = libs.versions.android.compile.sdk.get().toInt()
buildToolsVersion = libs.versions.android.build.tools.get()

sourceSets["main"].res.srcDirs("src/commonMain/resources")

defaultConfig {
minSdk = 21
minSdk = libs.versions.android.min.sdk.get().toInt()
}

compileOptions {
Expand Down Expand Up @@ -375,7 +370,7 @@ mavenPublishing {

name = productName
description = "Kotlin Multiplatform library for image metadata manipulation"
url = "https://github.com/Ashampoo/kim"
url = "https://github.com/Software-Rangers/kim"

licenses {
license {
Expand All @@ -384,16 +379,25 @@ mavenPublishing {
}
}

organization {
name = "Software Rangers GmbH"
url = "https://software-rangers.com/"
}

developers {
developer {
name = "Ashampoo GmbH & Co. KG"
url = "https://www.ashampoo.com/"
name = "Stefan Oltmann"
url = "https://stefan-oltmann.de/"
organization = "Software Rangers GmbH"
organizationUrl = "https://software-rangers.com/"
roles = listOf("maintainer", "developer")
properties = mapOf("github" to "StefanOltmann")
}
}

scm {
url = "https://github.com/Ashampoo/kim"
connection = "scm:git:git://github.com/Ashampoo/kim.git"
url = "https://github.com/Software-Rangers/kim"
connection = "scm:git:git://github.com/Software-Rangers/kim.git"
}
}
}
Expand Down
39 changes: 39 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[versions]
kotlin = "2.2.0"
android-gradle = "8.9.3"
android-compile-sdk = "36"
android-build-tools = "36.0.0"
android-min-sdk = "21"
detekt = "1.23.8"
kover = "0.9.1"
build-time-tracker = "5.0.1"
git-versioning = "6.4.4"
resources = "0.10.1"
versions-plugin = "0.52.0"
maven-publish = "0.34.0"

ktor = "3.2.2"
xmpcore = "1.6.0"
kotlinx-datetime = "0.7.1"
kotlinx-io = "0.8.0"
kotlinx-browser = "0.3"
pako = "2.1.0"

[libraries]
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
xmpcore = { module = "com.ashampoo:xmpcore", version.ref = "xmpcore" }
kotlinx-io-core = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version.ref = "kotlinx-io" }
ktor-io = { module = "io.ktor:ktor-io", version.ref = "ktor" }
kotlinx-browser = { module = "org.jetbrains.kotlinx:kotlinx-browser", version.ref = "kotlinx-browser" }
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }

[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
android-library = { id = "com.android.library", version.ref = "android-gradle" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
build-time-tracker = { id = "com.asarkar.gradle.build-time-tracker", version.ref = "build-time-tracker" }
git-versioning = { id = "me.qoomon.git-versioning", version.ref = "git-versioning" }
resources = { id = "com.goncalossilva.resources", version.ref = "resources" }
versions = { id = "com.github.ben-manes.versions", version.ref = "versions-plugin" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
package com.ashampoo.kim.common

import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.number

private const val YEAR_LENGTH = 4

internal fun LocalDateTime.toExifDateString(): String {

return year.toString().padStart(YEAR_LENGTH, '0') + ":" +
monthNumber.toString().padStart(2, '0') + ":" +
dayOfMonth.toString().padStart(2, '0') + " " +
month.number.toString().padStart(2, '0') + ":" +
day.toString().padStart(2, '0') + " " +
hour.toString().padStart(2, '0') + ":" +
minute.toString().padStart(2, '0') + ":" +
second.toString().padStart(2, '0')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,11 @@ public class TiffWriterLossless(

while (unplacedItems.isNotEmpty()) {

/* Pop off largest unplaced item. */
val outputItem = unplacedItems.removeFirst()
/*
* Pop off largest unplaced item.
* Note: Don't use removeFirst() for Android compatibility here.
*/
val outputItem = unplacedItems.removeAt(0)

val outputItemLength = outputItem.getItemLength()

Expand Down Expand Up @@ -336,7 +339,10 @@ public class TiffWriterLossless(

newExifBytesLength -= lastRange.length

filteredRewritableSpaceRanges.removeLast()
/*
* Note: Don't use removeLast() here due to Android incompatibility.
*/
filteredRewritableSpaceRanges.removeAt(filteredRewritableSpaceRanges.size - 1)
}

return filteredRewritableSpaceRanges to newExifBytesLength
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal class PrePendingByteReader(
override fun readByte(): Byte? {

if (prependedBytesBuffer.isNotEmpty())
return prependedBytesBuffer.removeFirst()
return prependedBytesBuffer.removeAt(0)

return delegate.readByte()
}
Expand All @@ -48,7 +48,7 @@ internal class PrePendingByteReader(
/* Read prepended bytes first */
while (bytesRead < count && prependedBytesBuffer.isNotEmpty()) {

bytes[bytesRead] = prependedBytesBuffer.removeFirst()
bytes[bytesRead] = prependedBytesBuffer.removeAt(0)

bytesRead++
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
File format : GIF
Resolution : 500 x 333
---- XMP ----
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
File format : GIF
Resolution : 500 x 333
---- XMP ----
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
File format : GIF
Resolution : 500 x 333
---- XMP ----
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:MY="http://ns.mylollc.com/MyloEdit/"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
File format : GIF
Resolution : 500 x 333
---- XMP ----
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:MY="http://ns.mylollc.com/MyloEdit/"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
File format : GIF
Resolution : 500 x 333
---- XMP ----
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
File format : GIF
Resolution : 500 x 333
---- XMP ----
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:exif="http://ns.adobe.com/exif/1.0/"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
File format : GIF
Resolution : 500 x 333
---- XMP ----
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
File format : GIF
Resolution : 500 x 333
---- XMP ----
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading