Skip to content

Commit d3bc7e6

Browse files
Small dependency updates + additional test (#14)
* Update to current Gradle & AGP * Added a unit test that actually triggers XMPNormalizer.tweakOldXMP() * Increase patch version
1 parent 8af2a88 commit d3bc7e6

8 files changed

Lines changed: 85 additions & 81 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ It's part of [Ashampoo Photos](https://ashampoo.com/photos).
1515
## Installation
1616

1717
```
18-
implementation("com.ashampoo:xmpcore:0.2.1")
18+
implementation("com.ashampoo:xmpcore:0.2.2")
1919
```
2020

2121
## How to use

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
33

44
plugins {
55
kotlin("multiplatform") version "1.9.21"
6-
id("com.android.library") version "7.4.2"
6+
id("com.android.library") version "8.0.2"
77
id("maven-publish")
88
id("signing")
99
id("io.gitlab.arturbosch.detekt") version "1.23.3"
@@ -22,7 +22,7 @@ repositories {
2222

2323
val productName = "Ashampoo XMP Core"
2424

25-
val ktorVersion: String = "2.3.5"
25+
val ktorVersion: String = "2.3.6"
2626
val xmlUtilVersion: String = "0.86.2"
2727

2828
description = productName
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

src/commonMain/kotlin/com/ashampoo/xmp/XMPNormalizer.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@ internal object XMPNormalizer {
6363

6464
if (checkUUIDFormat(nameStr)) {
6565

66-
// move UUID to xmpMM:InstanceID and remove it from the root node
66+
/* move UUID to xmpMM:InstanceID and remove it from the root node */
6767
val path = expandXPath(XMPConst.NS_XMP_MM, "InstanceID")
6868
val idNode = XMPNodeUtils.findNode(tree, path, true, null)
6969

7070
if (idNode == null)
7171
throw XMPException("Failure creating xmpMM:InstanceID", XMPError.INTERNALFAILURE)
7272

73-
idNode.options = PropertyOptions() // Clobber any existing xmpMM:InstanceID.
73+
/* Clobber any existing xmpMM:InstanceID */
74+
idNode.options = PropertyOptions()
7475
idNode.value = "uuid:$nameStr"
7576
idNode.removeChildren()
7677
idNode.removeQualifiers()

src/commonTest/kotlin/com/ashampoo/xmp/RewriteXmpTest.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ class RewriteXmpTest {
214214

215215
companion object {
216216

217+
/*
218+
* Note: sample_100.xml is the only one that
219+
* triggers XMPNormalizer.tweakOldXMP()
220+
*/
221+
217222
const val TEST_PHOTO_COUNT = 100
218223

219224
private const val RESOURCE_PATH: String = "src/commonTest/resources/com/ashampoo/xmp"
Lines changed: 53 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,54 @@
1-
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 6.0.0">
2-
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
3-
<rdf:Description rdf:about=""
4-
xmlns:exif="http://ns.adobe.com/exif/1.0/"
5-
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
6-
xmlns:MY="http://ns.mylollc.com/MyloEdit/"
7-
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
8-
xmlns:dc="http://purl.org/dc/elements/1.1/"
9-
exif:DateTimeOriginal="2023-07-03T10:24:16.000"
10-
exif:SubSecTime="0"
11-
exif:SubSecTimeOriginal="0"
12-
exif:SubSecTimeDigitized="0"
13-
xmp:CreateDate="2023-07-03T10:24:16.000"
14-
xmp:ModifyDate="2023-07-03T10:24:16.000"
15-
xmp:MetadataDate="2023-07-03T08:38:51.741Z"
16-
xmp:Rating="1"
17-
MY:DateRangeStart="2023-07-03T10:24:16.000"
18-
MY:DateRangeEnd="2023-07-03T10:24:16.000"
19-
MY:DateRangeScope=""
20-
MY:Undated="false"
21-
MY:flag="false"
22-
MY:processVersion="1"
23-
MY:MetadataDate="2023-07-03T08:38:51.741Z"
24-
xmpMM:DocumentID="F4B0CBDE-3B21-46AB-BAD0-9BEA764E84D9"
25-
xmpMM:OriginalDocumentID="F4B0CBDE-3B21-46AB-BAD0-9BEA764E84D9"
26-
xmpMM:InstanceID="xmp.iid:6E5C4F82-0EAB-4EE1-9AB3-0748412A6A85">
27-
<dc:subject>
28-
<rdf:Bag>
29-
<rdf:li>test</rdf:li>
30-
</rdf:Bag>
31-
</dc:subject>
32-
</rdf:Description>
33-
</rdf:RDF>
1+
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
2+
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 12.27'>
3+
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
4+
5+
<rdf:Description rdf:about='uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b'
6+
xmlns:MicrosoftPhoto='http://ns.microsoft.com/photo/1.0'>
7+
<MicrosoftPhoto:DateAcquired>2013-09-01T10:58:46.904</MicrosoftPhoto:DateAcquired>
8+
<MicrosoftPhoto:LastKeywordXMP>
9+
<rdf:Bag>
10+
<rdf:li>свадьба Алла+ Эльдар</rdf:li>
11+
</rdf:Bag>
12+
</MicrosoftPhoto:LastKeywordXMP>
13+
</rdf:Description>
14+
15+
<rdf:Description rdf:about='uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b'
16+
xmlns:dc='http://purl.org/dc/elements/1.1/'>
17+
<dc:subject>
18+
<rdf:Bag>
19+
<rdf:li>свадьба Алла+ Эльдар</rdf:li>
20+
</rdf:Bag>
21+
</dc:subject>
22+
</rdf:Description>
23+
24+
<rdf:Description rdf:about='uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b'
25+
xmlns:xmp='http://ns.adobe.com/xap/1.0/'>
26+
<xmp:Rating>3</xmp:Rating>
27+
</rdf:Description>
28+
</rdf:RDF>
3429
</x:xmpmeta>
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
<?xpacket end='w'?>

src/commonTest/resources/com/ashampoo/xmp/sample_100_formatted_canonical.xmp

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,23 @@
22
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.1.3">
33
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
44
<rdf:Description rdf:about=""
5-
xmlns:MY="http://ns.mylollc.com/MyloEdit/"
5+
xmlns:MicrosoftPhoto_1_="http://ns.microsoft.com/photo/1.0"
66
xmlns:dc="http://purl.org/dc/elements/1.1/"
7-
xmlns:exif="http://ns.adobe.com/exif/1.0/"
87
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
98
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
10-
<MY:DateRangeEnd>2023-07-03T10:24:16.000</MY:DateRangeEnd>
11-
<MY:DateRangeScope/>
12-
<MY:DateRangeStart>2023-07-03T10:24:16.000</MY:DateRangeStart>
13-
<MY:MetadataDate>2023-07-03T08:38:51.741Z</MY:MetadataDate>
14-
<MY:Undated>false</MY:Undated>
15-
<MY:flag>false</MY:flag>
16-
<MY:processVersion>1</MY:processVersion>
9+
<MicrosoftPhoto_1_:DateAcquired>2013-09-01T10:58:46.904</MicrosoftPhoto_1_:DateAcquired>
10+
<MicrosoftPhoto_1_:LastKeywordXMP>
11+
<rdf:Bag>
12+
<rdf:li>свадьба Алла+ Эльдар</rdf:li>
13+
</rdf:Bag>
14+
</MicrosoftPhoto_1_:LastKeywordXMP>
1715
<dc:subject>
1816
<rdf:Bag>
19-
<rdf:li>test</rdf:li>
17+
<rdf:li>свадьба Алла+ Эльдар</rdf:li>
2018
</rdf:Bag>
2119
</dc:subject>
22-
<exif:DateTimeOriginal>2023-07-03T10:24:16.000</exif:DateTimeOriginal>
23-
<exif:SubSecTime>0</exif:SubSecTime>
24-
<exif:SubSecTimeDigitized>0</exif:SubSecTimeDigitized>
25-
<exif:SubSecTimeOriginal>0</exif:SubSecTimeOriginal>
26-
<xmp:CreateDate>2023-07-03T10:24:16.000</xmp:CreateDate>
27-
<xmp:MetadataDate>2023-07-03T08:38:51.741Z</xmp:MetadataDate>
28-
<xmp:ModifyDate>2023-07-03T10:24:16.000</xmp:ModifyDate>
29-
<xmp:Rating>1</xmp:Rating>
30-
<xmpMM:DocumentID>F4B0CBDE-3B21-46AB-BAD0-9BEA764E84D9</xmpMM:DocumentID>
31-
<xmpMM:InstanceID>xmp.iid:6E5C4F82-0EAB-4EE1-9AB3-0748412A6A85</xmpMM:InstanceID>
32-
<xmpMM:OriginalDocumentID>F4B0CBDE-3B21-46AB-BAD0-9BEA764E84D9</xmpMM:OriginalDocumentID>
20+
<xmp:Rating>3</xmp:Rating>
21+
<xmpMM:InstanceID>uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b</xmpMM:InstanceID>
3322
</rdf:Description>
3423
</rdf:RDF>
3524
</x:xmpmeta>

src/commonTest/resources/com/ashampoo/xmp/sample_100_formatted_compact.xmp

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,21 @@
22
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.1.3">
33
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
44
<rdf:Description rdf:about=""
5-
xmlns:MY="http://ns.mylollc.com/MyloEdit/"
5+
xmlns:MicrosoftPhoto_1_="http://ns.microsoft.com/photo/1.0"
66
xmlns:dc="http://purl.org/dc/elements/1.1/"
7-
xmlns:exif="http://ns.adobe.com/exif/1.0/"
87
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
98
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
10-
MY:DateRangeEnd="2023-07-03T10:24:16.000"
11-
MY:DateRangeScope=""
12-
MY:DateRangeStart="2023-07-03T10:24:16.000"
13-
MY:MetadataDate="2023-07-03T08:38:51.741Z"
14-
MY:Undated="false"
15-
MY:flag="false"
16-
MY:processVersion="1"
17-
exif:DateTimeOriginal="2023-07-03T10:24:16.000"
18-
exif:SubSecTime="0"
19-
exif:SubSecTimeDigitized="0"
20-
exif:SubSecTimeOriginal="0"
21-
xmp:CreateDate="2023-07-03T10:24:16.000"
22-
xmp:MetadataDate="2023-07-03T08:38:51.741Z"
23-
xmp:ModifyDate="2023-07-03T10:24:16.000"
24-
xmp:Rating="1"
25-
xmpMM:DocumentID="F4B0CBDE-3B21-46AB-BAD0-9BEA764E84D9"
26-
xmpMM:InstanceID="xmp.iid:6E5C4F82-0EAB-4EE1-9AB3-0748412A6A85"
27-
xmpMM:OriginalDocumentID="F4B0CBDE-3B21-46AB-BAD0-9BEA764E84D9">
9+
MicrosoftPhoto_1_:DateAcquired="2013-09-01T10:58:46.904"
10+
xmp:Rating="3"
11+
xmpMM:InstanceID="uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b">
12+
<MicrosoftPhoto_1_:LastKeywordXMP>
13+
<rdf:Bag>
14+
<rdf:li>свадьба Алла+ Эльдар</rdf:li>
15+
</rdf:Bag>
16+
</MicrosoftPhoto_1_:LastKeywordXMP>
2817
<dc:subject>
2918
<rdf:Bag>
30-
<rdf:li>test</rdf:li>
19+
<rdf:li>свадьба Алла+ Эльдар</rdf:li>
3120
</rdf:Bag>
3221
</dc:subject>
3322
</rdf:Description>

0 commit comments

Comments
 (0)