Skip to content

Commit

Permalink
Support for JS target & "xmpDM:pick" (#23)
Browse files Browse the repository at this point in the history
* Dependency updates

* Bump version

* Added namespaces for various photo products

* Implemented XMPMeta.isFlagged()

* Implemented XMPMeta.setFlagged()

* Refactoring: Replaced integer constants with proper enum.

* Introduced "ashampoo:albums" schema

* Removed instanceof checks

* Added missing import

* XMPRDFParser: Removed instanceof checks for JS compatibility.

* Suppress warnings

* Suppress warnings

* Added JavaScript target
  • Loading branch information
StefanOltmann authored Mar 15, 2024
1 parent 1ad494b commit 60482e3
Show file tree
Hide file tree
Showing 214 changed files with 524 additions and 347 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# XMP Core for Kotlin Multiplatform

[![Kotlin](https://img.shields.io/badge/kotlin-1.9.22-blue.svg?logo=kotlin)](httpw://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-1.9.23-blue.svg?logo=kotlin)](httpw://kotlinlang.org)
![JVM](https://img.shields.io/badge/-JVM-gray.svg?style=flat)
![Android](https://img.shields.io/badge/-Android-gray.svg?style=flat)
![macOS](https://img.shields.io/badge/-macOS-gray.svg?style=flat)
![iOS](https://img.shields.io/badge/-iOS-gray.svg?style=flat)
![Windows](https://img.shields.io/badge/-Windows-gray.svg?style=flat)
![Linux](https://img.shields.io/badge/-Linux-gray.svg?style=flat)
![macOS](https://img.shields.io/badge/-macOS-gray.svg?style=flat)
![JS](https://img.shields.io/badge/-JS-gray.svg?style=flat)
![WASM](https://img.shields.io/badge/-WASM-gray.svg?style=flat)
![WASI](https://img.shields.io/badge/-WASI-gray.svg?style=flat)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=xmpcore&metric=coverage)](https://sonarcloud.io/summary/new_code?id=xmpcore)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.ashampoo/xmpcore/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.ashampoo/xmpcore)

Expand All @@ -18,7 +20,7 @@ It's part of [Ashampoo Photos](https://ashampoo.com/photos).
## Installation

```
implementation("com.ashampoo:xmpcore:1.1.0")
implementation("com.ashampoo:xmpcore:1.2.0")
```

## How to use
Expand Down
19 changes: 13 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
kotlin("multiplatform") version "1.9.22"
kotlin("multiplatform") version "1.9.23"
id("com.android.library") version "8.2.2"
id("maven-publish")
id("signing")
Expand All @@ -13,8 +13,8 @@ plugins {
id("com.asarkar.gradle.build-time-tracker") version "4.3.0"
id("me.qoomon.git-versioning") version "6.4.3"
id("com.goncalossilva.resources") version "0.4.0"
id("com.github.ben-manes.versions") version "0.50.0"
id("org.jetbrains.dokka") version "1.9.10"
id("com.github.ben-manes.versions") version "0.51.0"
id("org.jetbrains.dokka") version "1.9.20"
}

repositories {
Expand All @@ -25,6 +25,7 @@ repositories {
val productName = "Ashampoo XMP Core"

val xmlUtilVersion: String = "0.86.3"
val kotlinIoVersion: String = "0.3.1"

description = productName
group = "com.ashampoo"
Expand Down Expand Up @@ -103,7 +104,7 @@ koverMerged {
}

dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.4")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.5")
}

kotlin {
Expand Down Expand Up @@ -151,6 +152,8 @@ kotlin {
}
}

js()

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
// All tests reading from files fail, because kotlinx-io
Expand Down Expand Up @@ -180,7 +183,7 @@ kotlin {
implementation(kotlin("test"))

/* Multiplatform file access */
implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.3.0")
implementation("org.jetbrains.kotlinx:kotlinx-io-core:$kotlinIoVersion")
}
}

Expand Down Expand Up @@ -351,6 +354,7 @@ afterEvaluate {
val signWinPublication by tasks.getting
val signLinuxX64Publication by tasks.getting
val signLinuxArm64Publication by tasks.getting
val signJsPublication by tasks.getting
val signWasmJsPublication by tasks.getting
val signWasmWasiPublication by tasks.getting
val signKotlinMultiplatformPublication by tasks.getting
Expand All @@ -365,6 +369,7 @@ afterEvaluate {
val publishWinPublicationToSonatypeRepository by tasks.getting
val publishLinuxX64PublicationToSonatypeRepository by tasks.getting
val publishLinuxArm64PublicationToSonatypeRepository by tasks.getting
val publishJsPublicationToSonatypeRepository by tasks.getting
val publishWasmJsPublicationToSonatypeRepository by tasks.getting
val publishWasmWasiPublicationToSonatypeRepository by tasks.getting
val publishKotlinMultiplatformPublicationToSonatypeRepository by tasks.getting
Expand All @@ -375,7 +380,8 @@ afterEvaluate {
signIosArm64Publication, signIosX64Publication, signIosSimulatorArm64Publication,
signMacosArm64Publication, signMacosX64Publication, signWinPublication,
signLinuxX64Publication, signLinuxArm64Publication,
signWasmJsPublication, signWasmWasiPublication, signKotlinMultiplatformPublication
signJsPublication, signWasmJsPublication, signWasmWasiPublication,
signKotlinMultiplatformPublication
)

val publishTasks = listOf(
Expand All @@ -389,6 +395,7 @@ afterEvaluate {
publishWinPublicationToSonatypeRepository,
publishLinuxX64PublicationToSonatypeRepository,
publishLinuxArm64PublicationToSonatypeRepository,
publishJsPublicationToSonatypeRepository,
publishWasmJsPublicationToSonatypeRepository,
publishWasmWasiPublicationToSonatypeRepository,
publishKotlinMultiplatformPublicationToSonatypeRepository,
Expand Down
56 changes: 34 additions & 22 deletions src/commonMain/kotlin/com/ashampoo/xmp/XMPConst.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ object XMPConst {

const val NS_MWG_RS: String = "http://www.metadataworkinggroup.com/schemas/regions/"

const val NS_ACDSEE: String = "http://ns.acdsee.com/iptc/1.0/"

// Adobe standard namespaces

/**
* The XML namespace Adobe XMP Metadata.
*/
Expand All @@ -76,24 +72,12 @@ object XMPConst {
*/
const val NS_XMP_MM: String = "http://ns.adobe.com/xap/1.0/mm/"

/**
* The XML namespace for the job management schema.
*/
const val NS_XMP_BJ: String = "http://ns.adobe.com/xap/1.0/bj/"

/**
* The XML namespace for the job management schema.
*/
const val NS_XMP_NOTE: String = "http://ns.adobe.com/xmp/note/"

/**
* The XML namespace for the PDF schema.
*/
const val NS_PDF: String = "http://ns.adobe.com/pdf/1.3/"

/**
* The XML namespace for the PDF schema.
*/
const val NS_PDFX: String = "http://ns.adobe.com/pdfx/1.3/"

const val NS_PDFX_ID: String = "http://www.npes.org/pdfx/ns/id/"
Expand All @@ -110,11 +94,6 @@ object XMPConst {

const val NS_PDFA_EXTENSION: String = "http://www.aiim.org/pdfa/ns/extension/"

/**
* The XML namespace for the Photoshop custom schema.
*/
const val NS_PHOTOSHOP: String = "http://ns.adobe.com/photoshop/1.0/"

/**
* The XML namespace for the Photoshop Album schema.
*/
Expand Down Expand Up @@ -183,6 +162,16 @@ object XMPConst {
*/
const val NS_DC_DEPRECATED: String = "http://purl.org/dc/1.1/"

// Namespaces of products
const val NS_ASHAMPOO: String = "http://ns.ashampoo.com/xmp/1.0/"
const val NS_ACDSEE: String = "http://ns.acdsee.com/iptc/1.0/"
const val NS_DIGIKAM: String = "http://www.digikam.org/ns/1.0/"
const val NS_MYLIO: String = "http://ns.mylollc.com/MyloEdit/"
const val NS_NARRATIVE: String = "http://ns.narrative.so/narrative_select/1.0/"
const val NS_MICROSOFT_PHOTO: String = "http://ns.microsoft.com/photo/1.0/"
const val NS_LIGHTROOM: String = "http://ns.adobe.com/lightroom/1.0/"
const val NS_PHOTOSHOP: String = "http://ns.adobe.com/photoshop/1.0/"

// XML namespace constants for qualifiers and structured property fields.

/**
Expand Down Expand Up @@ -297,5 +286,28 @@ object XMPConst {
const val XMP_IPTC_EXT_PERSON_IN_IMAGE: String = "PersonInImage"

const val XMP_MWG_RS_TYPE_FACE: String = "Face"

const val XMP_MWG_RS_REGION_LIST: String = "Regions/mwg-rs:RegionList"
const val XMP_MWG_RS_APPLIED_TO_DIMENSIONS: String = "Regions/mwg-rs:AppliedToDimensions"

/* xmpDM:pick="1" or xmpDM:pick="0" */
const val FLAGGED_TAG_ADOBE_NAME: String = "pick"
const val FLAGGED_TAG_ADOBE_TRUE: String = "1"
const val FLAGGED_TAG_ADOBE_FALSE: String = "0"

/* <acdsee:tagged>True</acdsee:tagged> or <acdsee:tagged>False</acdsee:tagged> */
const val FLAGGED_TAG_ACDSEE_NAME: String = "tagged"
const val FLAGGED_TAG_ACDSEE_TRUE: String = TRUE_STRING
const val FLAGGED_TAG_ACDSEE_FALSE: String = FALSE_STRING

/* MY:flag="true" or MY:flag="false" */
const val FLAGGED_TAG_MYLIO_NAME: String = "flag"
const val FLAGGED_TAG_MYLIO_TRUE: String = "true"
const val FLAGGED_TAG_MYLIO_FALSE: String = "false"

/* narrative:Tagged="True" or narrative:Tagged="False" */
const val FLAGGED_TAG_NARRATIVE_NAME: String = "Tagged"
const val FLAGGED_TAG_NARRATIVE_TRUE: String = TRUE_STRING
const val FLAGGED_TAG_NARRATIVE_FALSE: String = FALSE_STRING

const val XMP_ASHAMPOO_ALBUMS: String = "albums"
}
Loading

0 comments on commit 60482e3

Please sign in to comment.