From cac2f45c1a3002ef7419383cc2a99a353470fb0a Mon Sep 17 00:00:00 2001 From: Stefan Oltmann Date: Thu, 28 Mar 2024 15:51:28 +0100 Subject: [PATCH 1/4] Added @kotlin.jvm.JvmStatic to all methods --- src/commonMain/kotlin/com/ashampoo/xmp/XMPMetaFactory.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commonMain/kotlin/com/ashampoo/xmp/XMPMetaFactory.kt b/src/commonMain/kotlin/com/ashampoo/xmp/XMPMetaFactory.kt index 9ecad67..6fd9a97 100644 --- a/src/commonMain/kotlin/com/ashampoo/xmp/XMPMetaFactory.kt +++ b/src/commonMain/kotlin/com/ashampoo/xmp/XMPMetaFactory.kt @@ -22,8 +22,10 @@ object XMPMetaFactory { @kotlin.jvm.JvmStatic val versionInfo = XMPVersionInfo + @kotlin.jvm.JvmStatic fun create(): XMPMeta = XMPMeta() + @kotlin.jvm.JvmStatic @Throws(XMPException::class) fun parseFromString( packet: String, @@ -31,6 +33,7 @@ object XMPMetaFactory { ): XMPMeta = XMPMetaParser.parse(packet, options) + @kotlin.jvm.JvmStatic @Throws(XMPException::class) fun serializeToString( xmp: XMPMeta, From 10d4405bbc7a95cabe3cd437eda5882c5b7d184b Mon Sep 17 00:00:00 2001 From: Stefan Oltmann Date: Thu, 28 Mar 2024 15:56:40 +0100 Subject: [PATCH 2/4] Added some JvmOverloads --- src/commonMain/kotlin/com/ashampoo/xmp/XMPMeta.kt | 11 +++++++++++ .../kotlin/com/ashampoo/xmp/XMPMetaFactory.kt | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/commonMain/kotlin/com/ashampoo/xmp/XMPMeta.kt b/src/commonMain/kotlin/com/ashampoo/xmp/XMPMeta.kt index 5fb84a2..dd27e15 100644 --- a/src/commonMain/kotlin/com/ashampoo/xmp/XMPMeta.kt +++ b/src/commonMain/kotlin/com/ashampoo/xmp/XMPMeta.kt @@ -338,6 +338,7 @@ class XMPMeta { * byte[] are handled, on all other `toString()` is called. * @param options Option flags describing the property. See the earlier description. */ + @kotlin.jvm.JvmOverloads fun setProperty( schemaNS: String, propName: String, @@ -419,6 +420,7 @@ class XMPMeta { * `setProperty()`. * @param options the set options for the item. */ + @kotlin.jvm.JvmOverloads fun setArrayItem( schemaNS: String, arrayName: String, @@ -459,6 +461,7 @@ class XMPMeta { * propValue in `setProperty()`. * @param options the set options that decide about the kind of the node. */ + @kotlin.jvm.JvmOverloads fun insertArrayItem( schemaNS: String, arrayName: String, @@ -507,6 +510,7 @@ class XMPMeta { * @param itemValue the value of the array item. Has the same usage as propValue in getProperty. * @param itemOptions Option flags describing the item to append ([PropertyOptions]) */ + @kotlin.jvm.JvmOverloads fun appendArrayItem( schemaNS: String, arrayName: String, @@ -622,6 +626,7 @@ class XMPMeta { * Has the same usage as propValue in getProperty. * @param options Option flags describing the field. See the earlier description. */ + @kotlin.jvm.JvmOverloads fun setStructField( schemaNS: String, structName: String, @@ -665,6 +670,7 @@ class XMPMeta { * in getProperty. * @param options Option flags describing the qualifier. See the earlier description. */ + @kotlin.jvm.JvmOverloads fun setQualifier( schemaNS: String, propName: String, @@ -1314,6 +1320,7 @@ class XMPMeta { * @param propValue the literal property value as `boolean`. * @param options options of the property to set (optional). */ + @kotlin.jvm.JvmOverloads fun setPropertyBoolean( schemaNS: String, propName: String, @@ -1334,6 +1341,7 @@ class XMPMeta { * @param propValue the literal property value as `int`. * @param options options of the property to set (optional). */ + @kotlin.jvm.JvmOverloads fun setPropertyInteger( schemaNS: String, propName: String, @@ -1349,6 +1357,7 @@ class XMPMeta { * @param propValue the literal property value as `long`. * @param options options of the property to set (optional). */ + @kotlin.jvm.JvmOverloads fun setPropertyLong( schemaNS: String, propName: String, @@ -1364,6 +1373,7 @@ class XMPMeta { * @param propValue the literal property value as `double`. * @param options options of the property to set (optional). */ + @kotlin.jvm.JvmOverloads fun setPropertyDouble( schemaNS: String, propName: String, @@ -1380,6 +1390,7 @@ class XMPMeta { * @param propValue the literal property value as byte array. * @param options options of the property to set (optional). */ + @kotlin.jvm.JvmOverloads fun setPropertyBase64( schemaNS: String, propName: String, diff --git a/src/commonMain/kotlin/com/ashampoo/xmp/XMPMetaFactory.kt b/src/commonMain/kotlin/com/ashampoo/xmp/XMPMetaFactory.kt index 6fd9a97..c408ca7 100644 --- a/src/commonMain/kotlin/com/ashampoo/xmp/XMPMetaFactory.kt +++ b/src/commonMain/kotlin/com/ashampoo/xmp/XMPMetaFactory.kt @@ -26,6 +26,7 @@ object XMPMetaFactory { fun create(): XMPMeta = XMPMeta() @kotlin.jvm.JvmStatic + @kotlin.jvm.JvmOverloads @Throws(XMPException::class) fun parseFromString( packet: String, @@ -34,6 +35,7 @@ object XMPMetaFactory { XMPMetaParser.parse(packet, options) @kotlin.jvm.JvmStatic + @kotlin.jvm.JvmOverloads @Throws(XMPException::class) fun serializeToString( xmp: XMPMeta, From 5eef3163d69ecc1de30dd5da3e4621142d6787aa Mon Sep 17 00:00:00 2001 From: Stefan Oltmann Date: Thu, 28 Mar 2024 16:07:12 +0100 Subject: [PATCH 3/4] Bumped version number and updated Java sample. --- README.md | 2 +- build.gradle.kts | 4 ++-- examples/xmpcore-java-sample/build.gradle | 2 +- .../xmpcore-java-sample/src/main/java/Main.java | 16 ++++------------ .../kotlin/com/ashampoo/xmp/XMPVersionInfo.kt | 2 +- .../kotlin/com/ashampoo/xmp/WriteXmpTest.kt | 9 ++++----- .../resources/com/ashampoo/xmp/empty.xmp | 2 +- .../resources/com/ashampoo/xmp/new.xmp | 2 +- .../resources/com/ashampoo/xmp/rating.xmp | 2 +- .../xmp/sample_100_formatted_canonical.xmp | 2 +- .../xmp/sample_100_formatted_compact.xmp | 2 +- .../xmp/sample_10_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_10_formatted_compact.xmp | 2 +- .../xmp/sample_11_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_11_formatted_compact.xmp | 2 +- .../xmp/sample_12_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_12_formatted_compact.xmp | 2 +- .../xmp/sample_13_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_13_formatted_compact.xmp | 2 +- .../xmp/sample_14_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_14_formatted_compact.xmp | 2 +- .../xmp/sample_15_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_15_formatted_compact.xmp | 2 +- .../xmp/sample_16_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_16_formatted_compact.xmp | 2 +- .../xmp/sample_17_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_17_formatted_compact.xmp | 2 +- .../xmp/sample_18_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_18_formatted_compact.xmp | 2 +- .../xmp/sample_19_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_19_formatted_compact.xmp | 2 +- .../xmp/sample_1_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_1_formatted_compact.xmp | 2 +- .../xmp/sample_20_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_20_formatted_compact.xmp | 2 +- .../xmp/sample_21_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_21_formatted_compact.xmp | 2 +- .../xmp/sample_22_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_22_formatted_compact.xmp | 2 +- .../xmp/sample_23_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_23_formatted_compact.xmp | 2 +- .../xmp/sample_24_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_24_formatted_compact.xmp | 2 +- .../xmp/sample_25_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_25_formatted_compact.xmp | 2 +- .../xmp/sample_26_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_26_formatted_compact.xmp | 2 +- .../xmp/sample_27_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_27_formatted_compact.xmp | 2 +- .../xmp/sample_28_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_28_formatted_compact.xmp | 2 +- .../xmp/sample_29_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_29_formatted_compact.xmp | 2 +- .../xmp/sample_2_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_2_formatted_compact.xmp | 2 +- .../xmp/sample_30_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_30_formatted_compact.xmp | 2 +- .../xmp/sample_31_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_31_formatted_compact.xmp | 2 +- .../xmp/sample_32_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_32_formatted_compact.xmp | 2 +- .../xmp/sample_33_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_33_formatted_compact.xmp | 2 +- .../xmp/sample_34_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_34_formatted_compact.xmp | 2 +- .../xmp/sample_35_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_35_formatted_compact.xmp | 2 +- .../xmp/sample_36_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_36_formatted_compact.xmp | 2 +- .../xmp/sample_37_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_37_formatted_compact.xmp | 2 +- .../xmp/sample_38_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_38_formatted_compact.xmp | 2 +- .../xmp/sample_39_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_39_formatted_compact.xmp | 2 +- .../xmp/sample_3_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_3_formatted_compact.xmp | 2 +- .../xmp/sample_40_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_40_formatted_compact.xmp | 2 +- .../xmp/sample_41_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_41_formatted_compact.xmp | 2 +- .../xmp/sample_42_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_42_formatted_compact.xmp | 2 +- .../xmp/sample_43_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_43_formatted_compact.xmp | 2 +- .../xmp/sample_44_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_44_formatted_compact.xmp | 2 +- .../xmp/sample_45_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_45_formatted_compact.xmp | 2 +- .../xmp/sample_46_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_46_formatted_compact.xmp | 2 +- .../xmp/sample_47_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_47_formatted_compact.xmp | 2 +- .../xmp/sample_48_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_48_formatted_compact.xmp | 2 +- .../xmp/sample_49_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_49_formatted_compact.xmp | 2 +- .../xmp/sample_4_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_4_formatted_compact.xmp | 2 +- .../xmp/sample_50_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_50_formatted_compact.xmp | 2 +- .../xmp/sample_51_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_51_formatted_compact.xmp | 2 +- .../xmp/sample_52_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_52_formatted_compact.xmp | 2 +- .../xmp/sample_53_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_53_formatted_compact.xmp | 2 +- .../xmp/sample_54_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_54_formatted_compact.xmp | 2 +- .../xmp/sample_55_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_55_formatted_compact.xmp | 2 +- .../xmp/sample_56_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_56_formatted_compact.xmp | 2 +- .../xmp/sample_57_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_57_formatted_compact.xmp | 2 +- .../xmp/sample_58_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_58_formatted_compact.xmp | 2 +- .../xmp/sample_59_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_59_formatted_compact.xmp | 2 +- .../xmp/sample_5_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_5_formatted_compact.xmp | 2 +- .../xmp/sample_60_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_60_formatted_compact.xmp | 2 +- .../xmp/sample_61_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_61_formatted_compact.xmp | 2 +- .../xmp/sample_62_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_62_formatted_compact.xmp | 2 +- .../xmp/sample_63_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_63_formatted_compact.xmp | 2 +- .../xmp/sample_64_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_64_formatted_compact.xmp | 2 +- .../xmp/sample_65_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_65_formatted_compact.xmp | 2 +- .../xmp/sample_66_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_66_formatted_compact.xmp | 2 +- .../xmp/sample_67_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_67_formatted_compact.xmp | 2 +- .../xmp/sample_68_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_68_formatted_compact.xmp | 2 +- .../xmp/sample_69_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_69_formatted_compact.xmp | 2 +- .../xmp/sample_6_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_6_formatted_compact.xmp | 2 +- .../xmp/sample_70_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_70_formatted_compact.xmp | 2 +- .../xmp/sample_71_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_71_formatted_compact.xmp | 2 +- .../xmp/sample_72_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_72_formatted_compact.xmp | 2 +- .../xmp/sample_73_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_73_formatted_compact.xmp | 2 +- .../xmp/sample_74_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_74_formatted_compact.xmp | 2 +- .../xmp/sample_75_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_75_formatted_compact.xmp | 2 +- .../xmp/sample_76_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_76_formatted_compact.xmp | 2 +- .../xmp/sample_77_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_77_formatted_compact.xmp | 2 +- .../xmp/sample_78_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_78_formatted_compact.xmp | 2 +- .../xmp/sample_79_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_79_formatted_compact.xmp | 2 +- .../xmp/sample_7_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_7_formatted_compact.xmp | 2 +- .../xmp/sample_80_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_80_formatted_compact.xmp | 2 +- .../xmp/sample_81_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_81_formatted_compact.xmp | 2 +- .../xmp/sample_82_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_82_formatted_compact.xmp | 2 +- .../xmp/sample_83_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_83_formatted_compact.xmp | 2 +- .../xmp/sample_84_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_84_formatted_compact.xmp | 2 +- .../xmp/sample_85_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_85_formatted_compact.xmp | 2 +- .../xmp/sample_86_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_86_formatted_compact.xmp | 2 +- .../xmp/sample_87_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_87_formatted_compact.xmp | 2 +- .../xmp/sample_88_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_88_formatted_compact.xmp | 2 +- .../xmp/sample_89_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_89_formatted_compact.xmp | 2 +- .../xmp/sample_8_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_8_formatted_compact.xmp | 2 +- .../xmp/sample_90_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_90_formatted_compact.xmp | 2 +- .../xmp/sample_91_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_91_formatted_compact.xmp | 2 +- .../xmp/sample_92_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_92_formatted_compact.xmp | 2 +- .../xmp/sample_93_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_93_formatted_compact.xmp | 2 +- .../xmp/sample_94_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_94_formatted_compact.xmp | 2 +- .../xmp/sample_95_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_95_formatted_compact.xmp | 2 +- .../xmp/sample_96_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_96_formatted_compact.xmp | 2 +- .../xmp/sample_97_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_97_formatted_compact.xmp | 2 +- .../xmp/sample_98_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_98_formatted_compact.xmp | 2 +- .../xmp/sample_99_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_99_formatted_compact.xmp | 2 +- .../xmp/sample_9_formatted_canonical.xmp | 2 +- .../ashampoo/xmp/sample_9_formatted_compact.xmp | 2 +- .../resources/com/ashampoo/xmp/updated.xmp | 2 +- 210 files changed, 217 insertions(+), 226 deletions(-) diff --git a/README.md b/README.md index 155300d..134de0e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ It's part of [Ashampoo Photos](https://ashampoo.com/photos). ## Installation ``` -implementation("com.ashampoo:xmpcore:1.2.1") +implementation("com.ashampoo:xmpcore:1.2.2") ``` ## How to use diff --git a/build.gradle.kts b/build.gradle.kts index 683077d..a41bc62 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { id("com.android.library") version "8.2.2" id("maven-publish") id("signing") - id("io.gitlab.arturbosch.detekt") version "1.23.5" + id("io.gitlab.arturbosch.detekt") version "1.23.6" id("org.sonarqube") version "4.3.1.3277" id("org.jetbrains.kotlinx.kover") version "0.6.1" id("com.asarkar.gradle.build-time-tracker") version "4.3.0" @@ -106,7 +106,7 @@ koverMerged { } dependencies { - detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.5") + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.6") } kotlin { diff --git a/examples/xmpcore-java-sample/build.gradle b/examples/xmpcore-java-sample/build.gradle index a30a579..98c7d92 100644 --- a/examples/xmpcore-java-sample/build.gradle +++ b/examples/xmpcore-java-sample/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - implementation 'com.ashampoo:xmpcore:1.2.1' + implementation 'com.ashampoo:xmpcore:1.2.2' } // Needed to make it work for the Gradle java plugin diff --git a/examples/xmpcore-java-sample/src/main/java/Main.java b/examples/xmpcore-java-sample/src/main/java/Main.java index eb02bcc..e8597fb 100644 --- a/examples/xmpcore-java-sample/src/main/java/Main.java +++ b/examples/xmpcore-java-sample/src/main/java/Main.java @@ -2,8 +2,6 @@ import com.ashampoo.xmp.XMPException; import com.ashampoo.xmp.XMPMeta; import com.ashampoo.xmp.XMPMetaFactory; -import com.ashampoo.xmp.options.ParseOptions; -import com.ashampoo.xmp.options.PropertyOptions; import com.ashampoo.xmp.options.SerializeOptions; import java.util.Set; @@ -18,13 +16,9 @@ public class Main { .setUseCanonicalFormat(false) .setSort(true); - private static final ParseOptions xmpParseOptions = - new ParseOptions() - .setRequireXMPMeta(false); - public static void main(String[] args) throws XMPException { - XMPMeta newXmpMeta = XMPMetaFactory.INSTANCE.create(); + XMPMeta newXmpMeta = XMPMetaFactory.create(); /* * Regular Adobe XMP Core API. @@ -33,8 +27,7 @@ public static void main(String[] args) throws XMPException { newXmpMeta.setPropertyInteger( XMPConst.NS_XMP, "Rating", - 3, - new PropertyOptions() + 3 ); /* Ashampoo XMP Core convenience method. */ @@ -42,7 +35,7 @@ public static void main(String[] args) throws XMPException { Set.of("cat", "cute", "animal") ); - String xmp = XMPMetaFactory.INSTANCE.serializeToString( + String xmp = XMPMetaFactory.serializeToString( newXmpMeta, xmpSerializeOptionsCompact ); @@ -68,8 +61,7 @@ public static void main(String[] args) throws XMPException { """; - XMPMeta oldXmpMeta = - XMPMetaFactory.INSTANCE.parseFromString(oldXmp, xmpParseOptions); + XMPMeta oldXmpMeta = XMPMetaFactory.parseFromString(oldXmp); System.out.println("---"); diff --git a/src/commonMain/kotlin/com/ashampoo/xmp/XMPVersionInfo.kt b/src/commonMain/kotlin/com/ashampoo/xmp/XMPVersionInfo.kt index e2a2b86..a99f2a2 100644 --- a/src/commonMain/kotlin/com/ashampoo/xmp/XMPVersionInfo.kt +++ b/src/commonMain/kotlin/com/ashampoo/xmp/XMPVersionInfo.kt @@ -9,7 +9,7 @@ object XMPVersionInfo { const val MAJOR: Int = 1 const val MINOR: Int = 2 - const val PATCH: Int = 1 + const val PATCH: Int = 2 const val VERSION_MESSAGE = "Ashampoo XMP Core $MAJOR.$MINOR.$PATCH" diff --git a/src/commonTest/kotlin/com/ashampoo/xmp/WriteXmpTest.kt b/src/commonTest/kotlin/com/ashampoo/xmp/WriteXmpTest.kt index c392d17..e0583af 100644 --- a/src/commonTest/kotlin/com/ashampoo/xmp/WriteXmpTest.kt +++ b/src/commonTest/kotlin/com/ashampoo/xmp/WriteXmpTest.kt @@ -1,6 +1,5 @@ package com.ashampoo.xmp -import com.ashampoo.xmp.options.PropertyOptions import com.ashampoo.xmp.options.SerializeOptions import kotlinx.io.buffered import kotlinx.io.files.Path @@ -32,7 +31,7 @@ class WriteXmpTest { val actualXmp = XMPMetaFactory.serializeToString(xmpMeta, xmpSerializeOptionsCompact) - val expectedXmp = getXmp("empty.xmp") + val expectedXmp = getXmp("com/ashampoo/xmp/empty.xmp") val equals = actualXmp.contentEquals(expectedXmp) @@ -62,7 +61,7 @@ class WriteXmpTest { val actualXmp = XMPMetaFactory.serializeToString(xmpMeta, xmpSerializeOptionsCompact) - val expectedXmp = getXmp("rating.xmp") + val expectedXmp = getXmp("com/ashampoo/xmp/rating.xmp") val equals = actualXmp.contentEquals(expectedXmp) @@ -92,7 +91,7 @@ class WriteXmpTest { val actualXmp = XMPMetaFactory.serializeToString(xmpMeta, xmpSerializeOptionsCompact) - val expectedXmp = getXmp("new.xmp") + val expectedXmp = getXmp("com/ashampoo/xmp/new.xmp") val equals = actualXmp.contentEquals(expectedXmp) @@ -144,7 +143,7 @@ class WriteXmpTest { val actualXmp = XMPMetaFactory.serializeToString(xmpMeta, xmpSerializeOptionsCompact) /* Since we apply the same updates it should look identical to the new.xmp */ - val expectedXmp = getXmp("new.xmp") + val expectedXmp = getXmp("com/ashampoo/xmp/new.xmp") val equals = actualXmp.contentEquals(expectedXmp) diff --git a/src/commonTest/resources/com/ashampoo/xmp/empty.xmp b/src/commonTest/resources/com/ashampoo/xmp/empty.xmp index 2a419ac..ecea12e 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/empty.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/empty.xmp @@ -1,5 +1,5 @@ - + diff --git a/src/commonTest/resources/com/ashampoo/xmp/new.xmp b/src/commonTest/resources/com/ashampoo/xmp/new.xmp index 198ecd4..f2bda6f 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/new.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/new.xmp @@ -1,5 +1,5 @@ - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_13_formatted_compact.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_13_formatted_compact.xmp index f4f290c..14cc05d 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_13_formatted_compact.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_13_formatted_compact.xmp @@ -1,5 +1,5 @@ - + - + diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_14_formatted_compact.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_14_formatted_compact.xmp index e726bcc..8cb3172 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_14_formatted_compact.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_14_formatted_compact.xmp @@ -1,5 +1,5 @@ - + - + diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_15_formatted_compact.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_15_formatted_compact.xmp index fea95f5..caf0530 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_15_formatted_compact.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_15_formatted_compact.xmp @@ -1,5 +1,5 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_31_formatted_compact.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_31_formatted_compact.xmp index e726bcc..8cb3172 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_31_formatted_compact.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_31_formatted_compact.xmp @@ -1,5 +1,5 @@ - + - + - + - + - + - + diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_34_formatted_compact.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_34_formatted_compact.xmp index e726bcc..8cb3172 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_34_formatted_compact.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_34_formatted_compact.xmp @@ -1,5 +1,5 @@ - + - + - + - + - + - + - + - + - + - + diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_39_formatted_compact.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_39_formatted_compact.xmp index f4f290c..14cc05d 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_39_formatted_compact.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_39_formatted_compact.xmp @@ -1,5 +1,5 @@ - + - + - + - + - + - + diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_41_formatted_compact.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_41_formatted_compact.xmp index f4f290c..14cc05d 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_41_formatted_compact.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_41_formatted_compact.xmp @@ -1,5 +1,5 @@ - + - + - + - + diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_43_formatted_compact.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_43_formatted_compact.xmp index afc2fe9..901f1cf 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_43_formatted_compact.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_43_formatted_compact.xmp @@ -1,5 +1,5 @@ - + - + diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_44_formatted_compact.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_44_formatted_compact.xmp index 2bdb623..2b48f84 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_44_formatted_compact.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_44_formatted_compact.xmp @@ -1,5 +1,5 @@ - + - + - + - + - + - + - + - + - + - + diff --git a/src/commonTest/resources/com/ashampoo/xmp/sample_49_formatted_compact.xmp b/src/commonTest/resources/com/ashampoo/xmp/sample_49_formatted_compact.xmp index e726bcc..8cb3172 100644 --- a/src/commonTest/resources/com/ashampoo/xmp/sample_49_formatted_compact.xmp +++ b/src/commonTest/resources/com/ashampoo/xmp/sample_49_formatted_compact.xmp @@ -1,5 +1,5 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + Date: Thu, 28 Mar 2024 16:31:49 +0100 Subject: [PATCH 4/4] Fixed unit test --- src/commonTest/kotlin/com/ashampoo/xmp/WriteXmpTest.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commonTest/kotlin/com/ashampoo/xmp/WriteXmpTest.kt b/src/commonTest/kotlin/com/ashampoo/xmp/WriteXmpTest.kt index e0583af..7a6ee91 100644 --- a/src/commonTest/kotlin/com/ashampoo/xmp/WriteXmpTest.kt +++ b/src/commonTest/kotlin/com/ashampoo/xmp/WriteXmpTest.kt @@ -31,7 +31,7 @@ class WriteXmpTest { val actualXmp = XMPMetaFactory.serializeToString(xmpMeta, xmpSerializeOptionsCompact) - val expectedXmp = getXmp("com/ashampoo/xmp/empty.xmp") + val expectedXmp = getXmp("empty.xmp") val equals = actualXmp.contentEquals(expectedXmp) @@ -61,7 +61,7 @@ class WriteXmpTest { val actualXmp = XMPMetaFactory.serializeToString(xmpMeta, xmpSerializeOptionsCompact) - val expectedXmp = getXmp("com/ashampoo/xmp/rating.xmp") + val expectedXmp = getXmp("rating.xmp") val equals = actualXmp.contentEquals(expectedXmp) @@ -91,7 +91,7 @@ class WriteXmpTest { val actualXmp = XMPMetaFactory.serializeToString(xmpMeta, xmpSerializeOptionsCompact) - val expectedXmp = getXmp("com/ashampoo/xmp/new.xmp") + val expectedXmp = getXmp("new.xmp") val equals = actualXmp.contentEquals(expectedXmp) @@ -143,7 +143,7 @@ class WriteXmpTest { val actualXmp = XMPMetaFactory.serializeToString(xmpMeta, xmpSerializeOptionsCompact) /* Since we apply the same updates it should look identical to the new.xmp */ - val expectedXmp = getXmp("com/ashampoo/xmp/new.xmp") + val expectedXmp = getXmp("new.xmp") val equals = actualXmp.contentEquals(expectedXmp)