Skip to content

Commit

Permalink
Fixes for JS target (#79)
Browse files Browse the repository at this point in the history
- Use JS compatible regex in png parser
- Updated to kotlinx-io v0.3.2 for bugfixes
  • Loading branch information
StefanOltmann authored Mar 18, 2024
1 parent e48ed63 commit 3b9cd28
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Logic for reading ISOBMFF containers was derived from 'metadata-extractor'
developed by Drew Noakes (https://github.com/drewnoakes/metadata-extractor).
Copyright 2002-2023 Drew Noakes and contributors

This product includes images from Unplash provided under
This product includes images from Unsplash provided under
the Unsplash license (https://unsplash.com/license).
These files are used as test data.

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ of Ashampoo Photos, which, in turn, is driven by user community feedback.
## Installation

```
implementation("com.ashampoo:kim:0.16")
implementation("com.ashampoo:kim:0.16.1")
```

For the targets `wasmJs` & `js` you also need to specify this:

```
implementation(npm("pako", "2.1.0"))
```

## Sample usages
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ val ktorVersion: String = "2.3.8"
val xmpCoreVersion: String = "1.2.0"
val dateTimeVersion: String = "0.5.0"
val testRessourcesVersion: String = "0.4.0"
val ioCoreVersion: String = "0.3.1"
val ioCoreVersion: String = "0.3.2"

description = productName
group = "com.ashampoo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ import com.ashampoo.kim.model.ImageFormat

object PngImageParser : ImageParser {

private val controlCharRegex = Regex("[\\p{Cntrl}]")
/* Note that [\\p{Cntrl}] does not work for Kotlin/JS. */
private val controlCharRegex = Regex("[\\x00-\\x1F\\x7F-\\x9F]")

private val metadataChunkTypes = listOf(
PngChunkType.IHDR,
Expand Down

0 comments on commit 3b9cd28

Please sign in to comment.