diff --git a/README.md b/README.md index ce0dad0..33e0675 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ It's part of [Ashampoo Photos](https://ashampoo.com/photos). ## Installation ``` -implementation("com.ashampoo:xmpcore:0.2.1") +implementation("com.ashampoo:xmpcore:0.2.2") ``` ## How to use diff --git a/build.gradle.kts b/build.gradle.kts index c5084f8..304c6ea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework plugins { kotlin("multiplatform") version "1.9.21" - id("com.android.library") version "7.4.2" + id("com.android.library") version "8.0.2" id("maven-publish") id("signing") id("io.gitlab.arturbosch.detekt") version "1.23.3" @@ -22,7 +22,7 @@ repositories { val productName = "Ashampoo XMP Core" -val ktorVersion: String = "2.3.5" +val ktorVersion: String = "2.3.6" val xmlUtilVersion: String = "0.86.2" description = productName diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 744c64d..3499ded 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/commonMain/kotlin/com/ashampoo/xmp/XMPNormalizer.kt b/src/commonMain/kotlin/com/ashampoo/xmp/XMPNormalizer.kt index a93bf7c..64cab72 100644 --- a/src/commonMain/kotlin/com/ashampoo/xmp/XMPNormalizer.kt +++ b/src/commonMain/kotlin/com/ashampoo/xmp/XMPNormalizer.kt @@ -63,14 +63,15 @@ internal object XMPNormalizer { if (checkUUIDFormat(nameStr)) { - // move UUID to xmpMM:InstanceID and remove it from the root node + /* move UUID to xmpMM:InstanceID and remove it from the root node */ val path = expandXPath(XMPConst.NS_XMP_MM, "InstanceID") val idNode = XMPNodeUtils.findNode(tree, path, true, null) if (idNode == null) throw XMPException("Failure creating xmpMM:InstanceID", XMPError.INTERNALFAILURE) - idNode.options = PropertyOptions() // Clobber any existing xmpMM:InstanceID. + /* Clobber any existing xmpMM:InstanceID */ + idNode.options = PropertyOptions() idNode.value = "uuid:$nameStr" idNode.removeChildren() idNode.removeQualifiers() diff --git a/src/commonTest/kotlin/com/ashampoo/xmp/RewriteXmpTest.kt b/src/commonTest/kotlin/com/ashampoo/xmp/RewriteXmpTest.kt index b731f7f..bbd072e 100644 --- a/src/commonTest/kotlin/com/ashampoo/xmp/RewriteXmpTest.kt +++ b/src/commonTest/kotlin/com/ashampoo/xmp/RewriteXmpTest.kt @@ -214,6 +214,11 @@ class RewriteXmpTest { companion object { + /* + * Note: sample_100.xml is the only one that + * triggers XMPNormalizer.tweakOldXMP() + */ + const val TEST_PHOTO_COUNT = 100 private const val RESOURCE_PATH: String = "src/commonTest/resources/com/ashampoo/xmp" diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_100.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_100.xmp index 4225bd9..39f4379 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_100.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_100.xmp @@ -1,34 +1,54 @@ - - - - - - test - - - - + + + + + + 2013-09-01T10:58:46.904 + + + свадьба Алла+ Эльдар + + + + + + + + свадьба Алла+ Эльдар + + + + + + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_100_formatted_canonical.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_100_formatted_canonical.xmp index 2dcb6be..58d3362 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_100_formatted_canonical.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_100_formatted_canonical.xmp @@ -2,34 +2,23 @@ - 2023-07-03T10:24:16.000 - - 2023-07-03T10:24:16.000 - 2023-07-03T08:38:51.741Z - false - false - 1 + 2013-09-01T10:58:46.904 + + + свадьба Алла+ Эльдар + + - test + свадьба Алла+ Эльдар - 2023-07-03T10:24:16.000 - 0 - 0 - 0 - 2023-07-03T10:24:16.000 - 2023-07-03T08:38:51.741Z - 2023-07-03T10:24:16.000 - 1 - F4B0CBDE-3B21-46AB-BAD0-9BEA764E84D9 - xmp.iid:6E5C4F82-0EAB-4EE1-9AB3-0748412A6A85 - F4B0CBDE-3B21-46AB-BAD0-9BEA764E84D9 + 3 + uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_100_formatted_compact.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_100_formatted_compact.xmp index 4124013..4936932 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_100_formatted_compact.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_100_formatted_compact.xmp @@ -2,32 +2,21 @@ + MicrosoftPhoto_1_:DateAcquired="2013-09-01T10:58:46.904" + xmp:Rating="3" + xmpMM:InstanceID="uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b"> + + + свадьба Алла+ Эльдар + + - test + свадьба Алла+ Эльдар