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/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 9ecad67..c408ca7 100644 --- a/src/commonMain/kotlin/com/ashampoo/xmp/XMPMetaFactory.kt +++ b/src/commonMain/kotlin/com/ashampoo/xmp/XMPMetaFactory.kt @@ -22,8 +22,11 @@ object XMPMetaFactory { @kotlin.jvm.JvmStatic val versionInfo = XMPVersionInfo + @kotlin.jvm.JvmStatic fun create(): XMPMeta = XMPMeta() + @kotlin.jvm.JvmStatic + @kotlin.jvm.JvmOverloads @Throws(XMPException::class) fun parseFromString( packet: String, @@ -31,6 +34,8 @@ object XMPMetaFactory { ): XMPMeta = XMPMetaParser.parse(packet, options) + @kotlin.jvm.JvmStatic + @kotlin.jvm.JvmOverloads @Throws(XMPException::class) fun serializeToString( xmp: XMPMeta, 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..7a6ee91 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 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 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +