-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests HEIC loading in apple platforms (#917)
* Tests HEIC loading in apple platforms * Try to use CGColorSpaceCreateDeviceRGB * It seems that the decoded HEIC image is different on some devices, let's use PSNR instead to be more lax
- Loading branch information
Showing
4 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
korim/src/darwinTest/kotlin/com/soywiz/korim/format/HEICTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.soywiz.korim.format | ||
|
||
import com.soywiz.korim.bitmap.* | ||
import com.soywiz.korio.async.* | ||
import com.soywiz.korio.file.std.* | ||
import kotlin.test.* | ||
|
||
class HEICTest { | ||
@Test | ||
fun test() = suspendTest { | ||
val heic = resourcesVfs["heic.heic"].readBitmap().toBMP32().premultiplied() | ||
val png = resourcesVfs["heic.heic.png"].readBitmap(PNG.toProps()).toBMP32().premultiplied() | ||
//localVfs("/tmp/heic.heic.png").writeBitmap(heic, PNG) | ||
assertGreaterOrEqual(30.0, Bitmap32.computePsnr(heic, png), message = "PSNR") | ||
} | ||
|
||
fun assertGreaterOrEqual(expected: Double, actual: Double, message: String = "") { | ||
assertTrue("Expected $actual >= $expected : $message") { actual >= expected } | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.