We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ea91cd7 + 66c4f66 commit cd455c8Copy full SHA for cd455c8
src/main/kotlin/totoro/pix/converter/Converter.kt
@@ -13,8 +13,12 @@ object Converter {
13
// encode width / height
14
val width = Math.min(image.width.toInt(), 160)
15
val height = Math.min(image.height.toInt(), 100)
16
- matrix.add(width.toByte())
17
- matrix.add((height / 2).toByte())
+
+ matrix.add((width shr 8 and 0xFF).toByte())
18
+ matrix.add((width shr 0 and 0xFF).toByte())
19
+ matrix.add((height / 2 shr 8 and 0xFF).toByte())
20
+ matrix.add((height / 2 shr 0 and 0xFF).toByte())
21
22
println("Width: $width")
23
println("Height: $height\n")
24
0 commit comments