From 5e6cd23c52abf8c840b235eb68744a9ab135c235 Mon Sep 17 00:00:00 2001 From: Stefan Oltmann Date: Thu, 24 Oct 2024 15:04:43 +0200 Subject: [PATCH] Migrated to Ktor 3 (#105) --- README.md | 6 +++--- build.gradle.kts | 7 +++---- gradle/wrapper/gradle-wrapper.properties | 2 +- .../kim/testdata/xmp/acdsee_sample_mod.xmp | 2 +- .../kim/testdata/xmp/digikam_sample_mod.xmp | 2 +- .../kim/testdata/xmp/exiftool_sample_mod.xmp | 2 +- .../kim/testdata/xmp/mylio_sample_mod.xmp | 2 +- .../xmp/narrative_from_mylio_sample_mod.xmp | 2 +- .../kim/testdata/xmp/narrative_sample_mod.xmp | 2 +- .../kim/updates_jpg/new_gps_coordinates.jpg | Bin 287511 -> 287511 bytes .../updates_jpg/new_gps_coordinates.jpg.txt | 2 +- .../new_gps_coordinates.no_metadata.jpg | Bin 265303 -> 265303 bytes .../new_gps_coordinates.no_metadata.jpg.txt | 2 +- .../ashampoo/kim/updates_jpg/new_keywords.jpg | Bin 287638 -> 287638 bytes .../kim/updates_jpg/new_keywords.jpg.txt | 2 +- .../updates_jpg/new_keywords.no_metadata.jpg | Bin 265324 -> 265324 bytes .../new_keywords.no_metadata.jpg.txt | 2 +- .../ashampoo/kim/updates_jpg/new_persons.jpg | Bin 287618 -> 287618 bytes .../kim/updates_jpg/new_persons.jpg.txt | 2 +- .../updates_jpg/new_persons.no_metadata.jpg | Bin 265236 -> 265236 bytes .../new_persons.no_metadata.jpg.txt | 2 +- .../ashampoo/kim/updates_jpg/new_rating.jpg | Bin 287352 -> 287352 bytes .../kim/updates_jpg/new_rating.jpg.txt | 2 +- .../updates_jpg/new_rating.no_metadata.jpg | Bin 265040 -> 265040 bytes .../new_rating.no_metadata.jpg.txt | 2 +- .../kim/updates_jpg/new_taken_date.jpg | Bin 287457 -> 287457 bytes .../kim/updates_jpg/new_taken_date.jpg.txt | 2 +- .../new_taken_date.no_metadata.jpg | Bin 265185 -> 265185 bytes .../new_taken_date.no_metadata.jpg.txt | 2 +- .../kim/updates_jpg/rotated_right.jpg | Bin 287430 -> 287430 bytes .../kim/updates_jpg/rotated_right.jpg.txt | 2 +- .../updates_jpg/rotated_right.no_metadata.jpg | Bin 265106 -> 265106 bytes .../rotated_right.no_metadata.jpg.txt | 2 +- .../kim/updates_jxl/new_gps_coordinates.jxl | Bin 901806 -> 901806 bytes .../updates_jxl/new_gps_coordinates.jxl.txt | 2 +- .../new_gps_coordinates.no_metadata.jxl | Bin 881887 -> 881887 bytes .../new_gps_coordinates.no_metadata.jxl.txt | 2 +- .../ashampoo/kim/updates_jxl/new_keywords.jxl | Bin 901699 -> 901699 bytes .../kim/updates_jxl/new_keywords.jxl.txt | 2 +- .../updates_jxl/new_keywords.no_metadata.jxl | Bin 881816 -> 881816 bytes .../new_keywords.no_metadata.jxl.txt | 2 +- .../ashampoo/kim/updates_jxl/new_persons.jxl | Bin 901753 -> 901753 bytes .../kim/updates_jxl/new_persons.jxl.txt | 2 +- .../updates_jxl/new_persons.no_metadata.jxl | Bin 881818 -> 881818 bytes .../new_persons.no_metadata.jxl.txt | 2 +- .../ashampoo/kim/updates_jxl/new_rating.jxl | Bin 901509 -> 901509 bytes .../kim/updates_jxl/new_rating.jxl.txt | 2 +- .../updates_jxl/new_rating.no_metadata.jxl | Bin 881622 -> 881622 bytes .../new_rating.no_metadata.jxl.txt | 2 +- .../kim/updates_jxl/new_taken_date.jxl | Bin 901626 -> 901626 bytes .../kim/updates_jxl/new_taken_date.jxl.txt | 2 +- .../new_taken_date.no_metadata.jxl | Bin 881769 -> 881769 bytes .../new_taken_date.no_metadata.jxl.txt | 2 +- .../kim/updates_jxl/rotated_right.jxl | Bin 901599 -> 901599 bytes .../kim/updates_jxl/rotated_right.jxl.txt | 2 +- .../updates_jxl/rotated_right.no_metadata.jxl | Bin 881690 -> 881690 bytes .../rotated_right.no_metadata.jxl.txt | 2 +- .../new_gps_coordinates.no_metadata.png | Bin 140106 -> 140106 bytes .../new_gps_coordinates.no_metadata.png.txt | 2 +- .../kim/updates_png/new_gps_coordinates.png | Bin 150945 -> 150945 bytes .../updates_png/new_gps_coordinates.png.txt | 4 ++-- .../updates_png/new_keywords.no_metadata.png | Bin 140035 -> 140035 bytes .../new_keywords.no_metadata.png.txt | 2 +- .../ashampoo/kim/updates_png/new_keywords.png | Bin 148636 -> 148636 bytes .../kim/updates_png/new_keywords.png.txt | 4 ++-- .../updates_png/new_persons.no_metadata.png | Bin 140037 -> 140037 bytes .../new_persons.no_metadata.png.txt | 2 +- .../ashampoo/kim/updates_png/new_persons.png | Bin 148690 -> 148690 bytes .../kim/updates_png/new_persons.png.txt | 4 ++-- .../updates_png/new_rating.no_metadata.png | Bin 139841 -> 139841 bytes .../new_rating.no_metadata.png.txt | 2 +- .../ashampoo/kim/updates_png/new_rating.png | Bin 148446 -> 148446 bytes .../kim/updates_png/new_rating.png.txt | 4 ++-- .../new_taken_date.no_metadata.png | Bin 139988 -> 139988 bytes .../new_taken_date.no_metadata.png.txt | 2 +- .../kim/updates_png/new_taken_date.png | Bin 150795 -> 150795 bytes .../kim/updates_png/new_taken_date.png.txt | 4 ++-- .../updates_png/rotated_right.no_metadata.png | Bin 139909 -> 139909 bytes .../rotated_right.no_metadata.png.txt | 2 +- .../kim/updates_png/rotated_right.png | Bin 150690 -> 150690 bytes .../kim/updates_png/rotated_right.png.txt | 4 ++-- .../new_gps_coordinates.no_metadata.webp | Bin 1909590 -> 1909590 bytes .../new_gps_coordinates.no_metadata.webp.txt | 2 +- .../kim/updates_webp/new_gps_coordinates.webp | Bin 1933012 -> 1933012 bytes .../updates_webp/new_gps_coordinates.webp.txt | 4 ++-- .../new_keywords.no_metadata.webp | Bin 1909522 -> 1909522 bytes .../new_keywords.no_metadata.webp.txt | 2 +- .../kim/updates_webp/new_keywords.webp | Bin 1925796 -> 1925796 bytes .../kim/updates_webp/new_keywords.webp.txt | 4 ++-- .../updates_webp/new_persons.no_metadata.webp | Bin 1909524 -> 1909524 bytes .../new_persons.no_metadata.webp.txt | 2 +- .../kim/updates_webp/new_persons.webp | Bin 1925850 -> 1925850 bytes .../kim/updates_webp/new_persons.webp.txt | 4 ++-- .../updates_webp/new_rating.no_metadata.webp | Bin 1909328 -> 1909328 bytes .../new_rating.no_metadata.webp.txt | 2 +- .../ashampoo/kim/updates_webp/new_rating.webp | Bin 1925606 -> 1925606 bytes .../kim/updates_webp/new_rating.webp.txt | 4 ++-- .../new_taken_date.no_metadata.webp | Bin 1909472 -> 1909472 bytes .../new_taken_date.no_metadata.webp.txt | 2 +- .../kim/updates_webp/new_taken_date.webp | Bin 1925712 -> 1925712 bytes .../kim/updates_webp/new_taken_date.webp.txt | 4 ++-- .../rotated_right.no_metadata.webp | Bin 1909392 -> 1909392 bytes .../rotated_right.no_metadata.webp.txt | 2 +- .../kim/updates_webp/rotated_right.webp | Bin 1925606 -> 1925606 bytes .../kim/updates_webp/rotated_right.webp.txt | 4 ++-- .../input/KtorByteReadChannelByteReader.kt | 7 ++++--- .../ashampoo/kim/input/KtorInputByteReader.kt | 16 +++++++++------- .../kotlin/com/ashampoo/kim/ktor/KimKtor.kt | 10 +++++----- 108 files changed, 91 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index 9d8790f5..c957d691 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Kim - Kotlin Image Metadata -[![Kotlin](https://img.shields.io/badge/kotlin-2.0.20-blue.svg?logo=kotlin)](httpw://kotlinlang.org) +[![Kotlin](https://img.shields.io/badge/kotlin-2.0.21-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) ![iOS](https://img.shields.io/badge/-iOS-gray.svg?style=flat) @@ -39,7 +39,7 @@ of Ashampoo Photo Organizer, which, in turn, is driven by user community feedbac ## Installation ``` -implementation("com.ashampoo:kim:0.19") +implementation("com.ashampoo:kim:0.20") ``` For the targets `wasmJs` & `js` you also need to specify this: @@ -53,7 +53,7 @@ implementation(npm("pako", "2.1.0")) ### Read metadata `Kim.readMetadata()` takes `kotlin.ByteArray` on all platforms and depending on -the platform also `kotlinx.io.files.Path`, Ktor `ByteReadPacket` & `ByteReadChannel`, +the platform also `kotlinx.io.files.Path`, Ktor `Source` & `ByteReadChannel`, `java.io.File`, `java.io.InputStream`, `NSData` and `String` paths. ```kotlin diff --git a/build.gradle.kts b/build.gradle.kts index 00613fc9..32eed17e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,11 +24,10 @@ repositories { val productName: String = "Ashampoo Kim" -val ktorVersion: String = "2.3.12" -val xmpCoreVersion: String = "1.4.1" +val ktorVersion: String = "3.0.0" +val xmpCoreVersion: String = "1.4.2" val dateTimeVersion: String = "0.6.1" -val testRessourcesVersion: String = "0.4.0" -val kotlinxIoVersion: String = "0.5.3" +val kotlinxIoVersion: String = "0.5.4" description = productName group = "com.ashampoo" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 707e499a..5c40527d 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.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/commonTest/resources/com/ashampoo/kim/testdata/xmp/acdsee_sample_mod.xmp b/src/commonTest/resources/com/ashampoo/kim/testdata/xmp/acdsee_sample_mod.xmp index 53714ab1..c10a5207 100644 --- a/src/commonTest/resources/com/ashampoo/kim/testdata/xmp/acdsee_sample_mod.xmp +++ b/src/commonTest/resources/com/ashampoo/kim/testdata/xmp/acdsee_sample_mod.xmp @@ -1,5 +1,5 @@ - + - + - + - + - + - + - + f-n;hGjE^3$a0(u0LhIC@c;k- delta 32 kcmcaUL*V)hfernPjE2n<7~3Z>f-n;hGjE^3$a0(u0Lga>@Bjb+ diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_gps_coordinates.no_metadata.jpg.txt b/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_gps_coordinates.no_metadata.jpg.txt index dc994349..33088570 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_gps_coordinates.no_metadata.jpg.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_gps_coordinates.no_metadata.jpg.txt @@ -18,7 +18,7 @@ Big-endian (Motorola, MM) ---- XMP ---- - + - + - + diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_persons.jpg b/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_persons.jpg index d0df475ad52cc3f3d1adbdf775a97fe959de9496..bb90c188bef18413f7bfca21b2cce298bbddcf08 100644 GIT binary patch delta 32 lcmZoVF4%NjaKn*sMx*AV;q6Dm8G)Dyh?%z^4QJWQ4FK+z4d4I( delta 32 lcmZoVF4%NjaKn*sM#JW#;q6Dm8G)Dyh?%z^4QJWQ4FK+d4c`C& diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_persons.jpg.txt b/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_persons.jpg.txt index eb134485..0993f164 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_persons.jpg.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_persons.jpg.txt @@ -135,7 +135,7 @@ Keywords (25) = 'people' ---- XMP ---- - + - + diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_rating.jpg b/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_rating.jpg index fbbd25181cdca232b09b608aede11f34b8ab470c..2c82d1a42bcef478a396301982afc80a79527b39 100644 GIT binary patch delta 32 lcmexyMDWKE!3{^k8I78chPNLLX9Qv - + bfe8;8jT#@dK4NTr#MJtTdFvyVJT3sPy$nJC delta 26 icmcaGP2j>bfe8;84I3Y|K4NTr#MJtTdFvyVJT3sPtPDW_ diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_rating.no_metadata.jpg.txt b/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_rating.no_metadata.jpg.txt index efbdd6c8..006c7920 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_rating.no_metadata.jpg.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_jpg/new_rating.no_metadata.jpg.txt @@ -2,7 +2,7 @@ File format : JPEG Resolution : 2304 x 1536 ---- XMP ---- - + - + - + - + - + tIF*6Xe05K~NvjH(X5OV-AClGT1F*gwNY!@-+ Hoz)KjYW@)N delta 68 zcmZ42YQC=3e1ottqhYg%al42yBM>tIF*6Xe05K~NvjH(X5OV-AClGT1F*gwNY!@-+ Hoz)KjYQzxn diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_gps_coordinates.jxl.txt b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_gps_coordinates.jxl.txt index 0e021c07..1377a313 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_gps_coordinates.jxl.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_gps_coordinates.jxl.txt @@ -70,7 +70,7 @@ Little-endian (Intel, II) ---- XMP ---- - + Y^;I delta 68 zcmccr()9jI(+zW(84a7~F}KfSW&~m;AO^8nfS47C*?^cGh&h0m6NtHhm>Y - + GXpUT5VHa?8xXStF$WNH0x=g5a|1EY_IFIY Gq5A>878>jT delta 68 zcmX@yVt%;Ae8XENM#JWJOzrQO7=ai>GXpUT5VHa?8xXStF$WNH0x=g5a|1EY_IFIY Gq5A>7+#2fu diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_keywords.jxl.txt b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_keywords.jxl.txt index 77163173..bc32052f 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_keywords.jxl.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_keywords.jxl.txt @@ -61,7 +61,7 @@ Little-endian (Intel, II) ---- XMP ---- - + %0WF}1&AVgzCk%?!jWK+FonY(UHo#2i4(3B+7L%nigm+ut$q Ht||lo+Q=JY delta 68 zcmbR7(sag4(+zK#7!8}>F}1&AVgzCk%?!jWK+FonY(UHo#2i4(3B+7L%nigm+ut$q Ht||lo+KwAy diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_keywords.no_metadata.jxl.txt b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_keywords.no_metadata.jxl.txt index f2738714..4af9533c 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_keywords.no_metadata.jxl.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_keywords.no_metadata.jxl.txt @@ -2,7 +2,7 @@ File format : JXL Resolution : null ---- XMP ---- - + diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_persons.jxl b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_persons.jxl index 4ae37b78b1d0ee9fa486c83bc059e4f8cd4db9c9..636a0593f4a22ac9cb59ee84b6a3d2499ef5bf2b 100644 GIT binary patch delta 68 zcmey_V*azme8XENMx*9;OzrQO7=ai>GXpUT5VHa?8xXStF$WNH0x=g5a|1EY_IFIY G-TMLBkQGXpUT5VHa?8xXStF$WNH0x=g5a|1EY_IFIY G-TMLBRvV1~ diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_persons.jxl.txt b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_persons.jxl.txt index b1642351..3e425bce 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_persons.jxl.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_persons.jxl.txt @@ -61,7 +61,7 @@ Little-endian (Intel, II) ---- XMP ---- - + %0WF}1&AVgzCk%?!jWK+FonY(UHo#2i4(3B+7L%nigm+ut$q Ht|F}1&AVgzCk%?!jWK+FonY(UHo#2i4(3B+7L%nigm+ut$q Ht| - + diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_rating.jxl b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_rating.jxl index 90e20f7fff86204c487fa39ef779a95441ca0229..cfe51c259ad2b1d55dd86baf77a31264b817a920 100644 GIT binary patch delta 68 zcmZo|Hg9b<-|&`+(WvKf2E^<@%mKulK+FZi+(68;{T&nU G^nC!G;2N(0 delta 68 zcmZo|Hg9b<-|&`+(Xja)Q~Nt6Mj!^!%s|Wn#H>Kf2E^<@%mKulK+FZi+(68;{T&nU G^nC!GrW&pQ diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_rating.jxl.txt b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_rating.jxl.txt index 34da6b47..1b3163ec 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_rating.jxl.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_rating.jxl.txt @@ -61,7 +61,7 @@ Little-endian (Intel, II) ---- XMP ---- - + %0WF}1&AVgzCk%?!jWK+FonY(UHo#2i4(3B+7L%nigm+ut$q Hz9;|y`g0r@ delta 68 zcmcci-1ORW(+zK#7!8}>F}1&AVgzCk%?!jWK+FonY(UHo#2i4(3B+7L%nigm+ut$q Hz9;|y`Z*jI diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_rating.no_metadata.jxl.txt b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_rating.no_metadata.jxl.txt index 95241b39..e75273db 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_rating.no_metadata.jxl.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_rating.no_metadata.jxl.txt @@ -2,7 +2,7 @@ File format : JXL Resolution : null ---- XMP ---- - + Z2qg+e8W^DMx*9wM(xv#7=f4xh?#+y1&CRJm<@>8ftUk`If0l9h`E87XZtiG H-jsd-iWC^% delta 68 zcmey>Z2qg+e8W^DM#JW5M(xv#7=f4xh?#+y1&CRJm<@>8ftUk`If0l9h`E87XZtiG H-jsd-iP{+6 diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_taken_date.jxl.txt b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_taken_date.jxl.txt index 97a439c1..ae6a182d 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_taken_date.jxl.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/new_taken_date.jxl.txt @@ -62,7 +62,7 @@ Little-endian (Intel, II) ---- XMP ---- - + - + 8ftUk`If0l9h`E87XZtiG HUeA62d)F9_ delta 68 zcmccLY<|Dle8W^DM#JW5M(xv#7=f4xh?#+y1&CRJm<@>8ftUk`If0l9h`E87XZtiG HUeA62dz~1K diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/rotated_right.jxl.txt b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/rotated_right.jxl.txt index 7d6ed2f8..7e91535e 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_jxl/rotated_right.jxl.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_jxl/rotated_right.jxl.txt @@ -62,7 +62,7 @@ Little-endian (Intel, II) ---- XMP ---- - + - + - + - + - + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.no_metadata.png b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.no_metadata.png index ab8642fcdad9a60168d9c0a081c6dceac57ad007..195d50c0f69ea359f55edc68858507bb4db142bb 100644 GIT binary patch delta 32 ocmZoZ#?gF?W5P*Bqm8E)FtSLtop5W;V`|T1V%(m`#57d_0NA(-#Q*>R delta 32 ocmZoZ#?gF?W5P*B!;PmFFtV(&RVr`JV`|T1V%(m`#57d_0M@1pmjD0& diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.no_metadata.png.txt b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.no_metadata.png.txt index 48402f5a..294065df 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.no_metadata.png.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.no_metadata.png.txt @@ -10,7 +10,7 @@ Time Created (60) = '15:28:58-15:28' ---- XMP ---- - + diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.png b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.png index 1bf27626844b587ee4becd48d89efc167c9ed832..7a494f1032d7d78f1913eefb922ce4ae254d2b88 100644 GIT binary patch delta 32 qcmV+*0N?+di3yyE36RMFGO^0f1q3y}<+g*J28W#n0k@q70{=beAq}(u delta 32 ocmbQ!$vLN!bHYhR!;PoTv$8ys-CEZ?m#uv+8{_u5Y)t=c0prUJS^xk5 diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.png.txt b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.png.txt index 1760e095..dfc287fa 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.png.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_keywords.png.txt @@ -130,7 +130,7 @@ Time Created (60) = '15:28:58-15:28' ---- XMP ---- - + - + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.no_metadata.png b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.no_metadata.png index 2be12c0ba8bbf252312433d66849180adaff125b..9a1a69ace832d41c53de780b2ce42a111c94c860 100644 GIT binary patch delta 32 ocmZoY#?g9=W5P*Bqm8E)F|vGBKhf7*z|>yA#JIhHiD{|=0Ol$TmH+?% delta 32 ocmZoY#?g9=W5P*B!;PmFF|rgdEq~Ztz|>yA#JIhHiD{|=0OcGElK=n! diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.no_metadata.png.txt b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.no_metadata.png.txt index 3d6698e8..1dca22a2 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.no_metadata.png.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.no_metadata.png.txt @@ -10,7 +10,7 @@ Time Created (60) = '15:28:58-15:28' ---- XMP ---- - + diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.png b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.png index c8af609cf23970924683c5470de255337cc266e8..18c1db009adfa414cb8a2e50c3b866947be7721f 100644 GIT binary patch delta 40 wcmccA$$6=hbHYhRqm8Fn**Nahd!Axokd2${s3O|@hOPY#8{_sjY)sE=0Z8BvmH+?% delta 40 wcmccA$$6=hbHYhR!;Pm{**G2+md|Hkkd2${s3O|@hOPY#8{_sjY)sE=0Z3jCj{pDw diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.png.txt b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.png.txt index 702be082..97b94920 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.png.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_persons.png.txt @@ -130,7 +130,7 @@ Time Created (60) = '15:28:58-15:28' ---- XMP ---- - + - + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_rating.no_metadata.png b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_rating.no_metadata.png index e4f8cad3b823913144b5c0beb73dda93254bb787..2fb542f299aaf40181646b956c744d01b8693796 100644 GIT binary patch delta 31 pcmV+)0O0?@#0bH}2$0DEGLg#O1eBeIi-W8IhpYhsx2ypIl_2ru4W - + - + - + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_taken_date.no_metadata.png b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_taken_date.no_metadata.png index caa36cee6d37422334df4135c271f6efecd95587..f848e179fdca38712e938a078c9bd206eeb49046 100644 GIT binary patch delta 34 qcmca|l;g@#jt!QKj7FQS7#SH^Jl{=U*KE(!ZqLNH-JXeQssaGoObZME delta 34 qcmca|l;g@#jt!QKjE0-77#SH^B7Tc>HQO__+cPn4w`XFSssI4eUJ8H! diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_taken_date.no_metadata.png.txt b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_taken_date.no_metadata.png.txt index 6258bb89..412c618c 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_png/new_taken_date.no_metadata.png.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_png/new_taken_date.no_metadata.png.txt @@ -20,7 +20,7 @@ Time Created (60) = '15:28:58-15:28' ---- XMP ---- - + - + - + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_png/rotated_right.no_metadata.png b/src/commonTest/resources/com/ashampoo/kim/updates_png/rotated_right.no_metadata.png index 0361708125a05f3c359d08ba760fa0e4fc49430a..c3451c0780731ea613ab69dfdc453a68c2ac7448 100644 GIT binary patch delta 33 pcmZoY%F%k1V*@KAqtRqG#%C;-zJFTP{DHCk10&=14~$Gx6#(Yd4Z{Ec delta 33 pcmZoY%F%k1V*@KAqv2#W#%C-=WeW3}KQOj`U}W6>fstvd0szZc3 - + zdnP!nWj;ZRv%*37HZ&a1 - + - + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_gps_coordinates.no_metadata.webp b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_gps_coordinates.no_metadata.webp index c4e3a1c825c7f0cbea1874f8323c85b49ff93810..ef4b96b92f22d04ea2e827dfd328f28e51e7c5e6 100644 GIT binary patch delta 75 zcmV~$M-hN96hOfVz4s2ELnLrQSOjo*l9<6kBt#Fp&KhUUgTlinAS5CtAtfWHproRv Yp{1i|U}R!uVP#|Icty0jzEjJse&c@^Hvj+t delta 75 zcmV~$M-hN96hOfVz4s2ELmY5JSOjo*l9<6kBt#Fp&KhUUgTlinAS5CtAtfWHproRv Yp{1i|U}R!uVP#|Icty0jzEjJse&cu-HUIzs diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_gps_coordinates.no_metadata.webp.txt b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_gps_coordinates.no_metadata.webp.txt index 7a3f4edd..7b67c793 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_gps_coordinates.no_metadata.webp.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_gps_coordinates.no_metadata.webp.txt @@ -18,7 +18,7 @@ Big-endian (Motorola, MM) ---- XMP ---- - + <1lvI6CEQR^{76VF;&m)>XRJ0>KL{LLJbVH|B4QF!GI9z^ ZDry>9I(i01CT12^wpX4?9N(qnz5fYm81?`F delta 75 zcmV~$w+(XRJ0>KL{LLJbVH|B4QF!GI9z^ ZDry>9I(i01CT12^wpX4?9N(qnz5fYf81(=E diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_gps_coordinates.webp.txt b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_gps_coordinates.webp.txt index b7c8d4ae..7619b4c8 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_gps_coordinates.webp.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_gps_coordinates.webp.txt @@ -70,7 +70,7 @@ Little-endian (Intel, II) ---- XMP ---- - + - + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.no_metadata.webp b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.no_metadata.webp index 585ab8a27fd4902ca5abe10109474f740a20341d..527983f48d66ac243ff6e1d0c672ac2b673abbf6 100644 GIT binary patch delta 75 zcmV~$R}FwL06@W%y(xS4qZV)msQ^Bnf+|1+2@a}@JL`;f=0@P*6A%&+laP{;Q&3V- aBWY;q=ouK9m|0la*k5&OaeS9nkN5$?A{V^? delta 75 zcmV~$R}FwL06@W%y(xS4qY{t?sQ^Bnf+|1+2@a}@JL`;f=0@P*6A%&+laP{;Q&3V- aBWY;q=ouK9m|0la*k5&OaeS9nkN5$?8yCC) diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.no_metadata.webp.txt b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.no_metadata.webp.txt index 381ee8fe..66068da1 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.no_metadata.webp.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.no_metadata.webp.txt @@ -2,7 +2,7 @@ File format : WEBP Resolution : 5184 x 3456 ---- XMP ---- - + diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.webp b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.webp index 33e11f296e648c5f30a7e6e7d856e9c8cb6179d4..260b998dd9604237c05e5580c679b78926c5db0f 100644 GIT binary patch delta 75 zcmV~$SrLFB06@XPTfzH2FoYSX#J?XegaL@)j0x!FuJhJ;dm{)4iHJ!^$;c^?C`u}7 Z8d^Gf21X`k7FITPj#o<~u1^{LoIl7=7jOUo delta 75 zcmV~$SrLFB06@XPTfzH2u!9|_#J?XegaL@)j0x!FuJhJ;dm{)4iHJ!^$;c^?C`u}7 Z8d^Gf21X`k7FITPj#o<~u1^{LoIl7(7jFOn diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.webp.txt b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.webp.txt index 7149ed57..f254b3cf 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.webp.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_keywords.webp.txt @@ -62,7 +62,7 @@ Little-endian (Intel, II) ---- XMP ---- - + - + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.no_metadata.webp b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.no_metadata.webp index cb3c5fc86c9cc4a7d223df49647411e15d088dd6..9efc4c6b954a127b363eb58f76f646c4c5ef73a9 100644 GIT binary patch delta 75 zcmV~$R}FwL06@W%y(xS4qZV)msQ^BngepJ-2@a}@JL`;f=0@P*6A%&+laP{;Q&3V- aBWY;q=ouK9m|0la*k5&OaeS9nkN5$@Oc%od delta 75 zcmV~$R}FwL06@W%y(xS4qY{t?sQ^BngepJ-2@a}@JL`;f=0@P*6A%&+laP{;Q&3V- aBWY;q=ouK9m|0la*k5&OaeS9nkN5$@MHj*V diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.no_metadata.webp.txt b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.no_metadata.webp.txt index 694572dd..f75c9408 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.no_metadata.webp.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.no_metadata.webp.txt @@ -2,7 +2,7 @@ File format : WEBP Resolution : 5184 x 3456 ---- XMP ---- - + diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.webp b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.webp index 6a704eeba2c5244a5a3bfdb1f6523ba6b817f274..09108f5ac470a1d6d0e09e28574f51f5985cf7c2 100644 GIT binary patch delta 75 zcmV~$#}R-a006feyS^(9!>z(z^-UtFhB4QF!GI9zeijs<& ZhL(<=fsu)sg_Vt+s3a7=MU$;7!m*g delta 75 zcmV~$#}R-a006feyS^(9!>z(z^-UtFhB4QF!GI9zeijs<& ZhL(<=fsu)sg_Vt+s3a7=MU$%7!d#f diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.webp.txt b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.webp.txt index 90a6c151..1ae0cae0 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.webp.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_persons.webp.txt @@ -62,7 +62,7 @@ Little-endian (Intel, II) ---- XMP ---- - + - + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_rating.no_metadata.webp b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_rating.no_metadata.webp index b4aa1656cad67e4aa5fd537ca60c66d8bb1aae64..f56465ee9d559543d62ade3b399d61b13160f3cb 100644 GIT binary patch delta 74 zcmV~$M-hN9006-Wy%T!PBNlK569GKV14fV#0a1V!cAYiOnj3+KPe4dSOhQUVPC-dU ZjijNaqi0}bVrF4wV}I4D#qnHPeLu_t7*YTL delta 74 zcmV~$M-hN9006-Wy%T!PBNC7X69GKV14fV#0a1V!cAYiOnj3+KPe4dSOhQUVPC-dU ZjijNaqi0}bVrF4wV}I4D#qnHPeLu_n7*PNK diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_rating.no_metadata.webp.txt b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_rating.no_metadata.webp.txt index a277e80b..805ebc47 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_rating.no_metadata.webp.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_rating.no_metadata.webp.txt @@ -2,7 +2,7 @@ File format : WEBP Resolution : 5184 x 3456 ---- XMP ---- - + 1g%n$9C7%>0< delta 75 zcmV~$SrLFB06@XPTS3M9B!nHP#J?Xek~0RNg#pOnZtyO6cO!_1Nl3}aDJZFsC~6v7 ZG#xzyBNH1g%n$957%%_; diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_rating.webp.txt b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_rating.webp.txt index 30483b6d..aab06f38 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_rating.webp.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_rating.webp.txt @@ -62,7 +62,7 @@ Little-endian (Intel, II) ---- XMP ---- - + - + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_taken_date.no_metadata.webp b/src/commonTest/resources/com/ashampoo/kim/updates_webp/new_taken_date.no_metadata.webp index 4d76ecc433922d739c1576ef4323e5d374a7f215..a6debae782f9ebbc72730c85182942dd8743f7c8 100644 GIT binary patch delta 75 zcmV~$*A0Lm06@Wjy<@L@u!6HOfFExp6DME{4WoGHo%POM2qXa^5itoV894 - + - + - + \ No newline at end of file diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/rotated_right.no_metadata.webp b/src/commonTest/resources/com/ashampoo/kim/updates_webp/rotated_right.no_metadata.webp index 32aa8c44cf49b07b1d56f9f82f846de3487cc432..d8b930960fc9b7b9d4153e2086b9fd4d65249537 100644 GIT binary patch delta 74 zcmV~$Hx+;|06@VPdMEUnAr{aU0SsS2HZ;JDg;+rcch(u}%!$CmCm - + 1g%n$9C7%>0< delta 75 zcmV~$SrLFB06@XPTS3M9B!nHP#J?Xek~0RNg#pOnZtyO6cO!_1Nl3}aDJZFsC~6v7 ZG#xzyBNH1g%n$957%%_; diff --git a/src/commonTest/resources/com/ashampoo/kim/updates_webp/rotated_right.webp.txt b/src/commonTest/resources/com/ashampoo/kim/updates_webp/rotated_right.webp.txt index 4a608648..cc9f0d5c 100644 --- a/src/commonTest/resources/com/ashampoo/kim/updates_webp/rotated_right.webp.txt +++ b/src/commonTest/resources/com/ashampoo/kim/updates_webp/rotated_right.webp.txt @@ -62,7 +62,7 @@ Little-endian (Intel, II) ---- XMP ---- - + - + \ No newline at end of file diff --git a/src/ktorMain/kotlin/com/ashampoo/kim/input/KtorByteReadChannelByteReader.kt b/src/ktorMain/kotlin/com/ashampoo/kim/input/KtorByteReadChannelByteReader.kt index 0311c86c..4b03aec5 100644 --- a/src/ktorMain/kotlin/com/ashampoo/kim/input/KtorByteReadChannelByteReader.kt +++ b/src/ktorMain/kotlin/com/ashampoo/kim/input/KtorByteReadChannelByteReader.kt @@ -17,8 +17,9 @@ package com.ashampoo.kim.input import io.ktor.utils.io.ByteReadChannel import io.ktor.utils.io.cancel -import io.ktor.utils.io.core.readBytes +import io.ktor.utils.io.readRemaining import kotlinx.coroutines.runBlocking +import kotlinx.io.readByteArray /** * This class allows streaming data from a cloud service and read only the headers. @@ -41,7 +42,7 @@ public class KtorByteReadChannelByteReader( return null buffer = runBlocking { - channel.readRemaining(limit = bufferSize).readBytes() + channel.readRemaining(max = bufferSize).readByteArray() } bufferLimit = buffer.size bufferOffset = 0 @@ -64,7 +65,7 @@ public class KtorByteReadChannelByteReader( break buffer = runBlocking { - channel.readRemaining(limit = bufferSize).readBytes() + channel.readRemaining(max = bufferSize).readByteArray() } bufferLimit = buffer.size bufferOffset = 0 diff --git a/src/ktorMain/kotlin/com/ashampoo/kim/input/KtorInputByteReader.kt b/src/ktorMain/kotlin/com/ashampoo/kim/input/KtorInputByteReader.kt index eee2966d..63faa4d4 100644 --- a/src/ktorMain/kotlin/com/ashampoo/kim/input/KtorInputByteReader.kt +++ b/src/ktorMain/kotlin/com/ashampoo/kim/input/KtorInputByteReader.kt @@ -15,8 +15,10 @@ */ package com.ashampoo.kim.input -import io.ktor.utils.io.core.ByteReadPacket -import io.ktor.utils.io.core.readBytes +import io.ktor.utils.io.core.endOfInput +import io.ktor.utils.io.core.remaining +import kotlinx.io.Source +import kotlinx.io.readByteArray /** * This class provides a convenient way to parse metadata directly from @@ -24,17 +26,17 @@ import io.ktor.utils.io.core.readBytes * of files hosted on a cloud service, which is a common use case. */ public class KtorInputByteReader( - private val byteReadPacket: ByteReadPacket + private val source: Source ) : ByteReader { - override val contentLength: Long = byteReadPacket.remaining + override val contentLength: Long = source.remaining override fun readByte(): Byte? = - if (byteReadPacket.endOfInput) null else byteReadPacket.readByte() + if (source.endOfInput) null else source.readByte() override fun readBytes(count: Int): ByteArray = - byteReadPacket.readBytes(minOf(count, byteReadPacket.remaining.toInt())) + source.readByteArray(minOf(count, source.remaining.toInt())) override fun close(): Unit = - byteReadPacket.close() + source.close() } diff --git a/src/ktorMain/kotlin/com/ashampoo/kim/ktor/KimKtor.kt b/src/ktorMain/kotlin/com/ashampoo/kim/ktor/KimKtor.kt index 5f25f2c2..0a2c816d 100644 --- a/src/ktorMain/kotlin/com/ashampoo/kim/ktor/KimKtor.kt +++ b/src/ktorMain/kotlin/com/ashampoo/kim/ktor/KimKtor.kt @@ -21,7 +21,7 @@ import com.ashampoo.kim.format.ImageMetadata import com.ashampoo.kim.input.KtorByteReadChannelByteReader import com.ashampoo.kim.input.KtorInputByteReader import io.ktor.utils.io.ByteReadChannel -import io.ktor.utils.io.core.ByteReadPacket +import kotlinx.io.Source import kotlin.jvm.JvmStatic /** @@ -31,8 +31,8 @@ public object KimKtor { @JvmStatic @Throws(ImageReadException::class) - public fun readMetadata(byteReadPacket: ByteReadPacket): ImageMetadata? = - Kim.readMetadata(KtorInputByteReader(byteReadPacket)) + public fun readMetadata(source: Source): ImageMetadata? = + Kim.readMetadata(KtorInputByteReader(source)) @JvmStatic @Throws(ImageReadException::class) @@ -41,8 +41,8 @@ public object KimKtor { } @Throws(ImageReadException::class) -public fun Kim.readMetadata(byteReadPacket: ByteReadPacket): ImageMetadata? = - KimKtor.readMetadata(byteReadPacket) +public fun Kim.readMetadata(source: Source): ImageMetadata? = + KimKtor.readMetadata(source) @Throws(ImageReadException::class) public fun Kim.readMetadata(byteReadChannel: ByteReadChannel, contentLength: Long): ImageMetadata? =