ImageRepository: rotations and thumbnails are not stored on disk anymore

This commit is contained in:
Pierre-Yves Nicolas
2026-03-27 08:46:35 +01:00
parent 69690d5c2a
commit 446b915d59
7 changed files with 179 additions and 181 deletions

View File

@@ -50,3 +50,14 @@ fun encodeJpeg(mat: Mat, jpegQuality: Int): ByteArray {
encoded.release()
return result
}
fun decodeJpeg(jpegBytes: ByteArray): Mat {
val src = MatOfByte(*jpegBytes)
val decoded = Imgcodecs.imdecode(src, Imgcodecs.IMREAD_COLOR)
src.release()
if (decoded.empty()) {
decoded.release()
throw IllegalStateException("Failed to decode JPEG")
}
return decoded
}