From 50bc2f45b5c6bc31427033c3bdb6aee5218e765a Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 18 Jun 2019 12:48:49 +0200 Subject: [PATCH] improve the performance at checking if a video is panorama --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index c6582ccc2..2298bfaaf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -741,7 +741,7 @@ fun Context.parseFileChannel(path: String, fc: FileChannel, level: Int, start: L val sb = StringBuilder() val buffer = ByteArray(1024) - while (true) { + while (sb.length < size) { val n = fis.read(buffer) if (n != -1) { sb.append(String(buffer, 0, n))