Skip to content

Commit a393bb5

Browse files
committed
fix: gif delay & result display
1 parent eac5563 commit a393bb5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

RealSR-NCNN-Android-GUI/app/src/main/java/com/tumuyan/ncnn/realsr/MainActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,8 @@ public boolean onQueryTextChange(String newText) {
779779
if (showImgView) {
780780
if (outputFile.exists() && outputFile.isFile()) {
781781
updateImage(dir + "/output.png", String.format("%s\n%s", getString(R.string.hr), log), false);
782-
} else if (inputIsGifAnimation && new File(outputSavePath).exists()) {
783-
updateImage(outputSavePath, String.format("%s\n%s", getString(R.string.hr), log), false);
782+
} else if (inputIsGifAnimation && outputFile.exists() && outputFile.isDirectory() && outputFile.listFiles().length>1) {
783+
updateImage(outputFile.listFiles()[0].getPath(), String.format("%s\n%s", getString(R.string.hr), log), false);
784784
} else {
785785
updateImage(dir + "/input.png", String.format("%s\n%s", getString(R.string.lr), log), false);
786786
}
@@ -1077,7 +1077,7 @@ public synchronized boolean run20(@NonNull String cmd, boolean bench_mark_mode,b
10771077
if (save) {
10781078
String export_cmd = saveOutputCmd();
10791079
if (inputIsGifAnimation)
1080-
cmd = cmd + ";" + "echo convert gif file;./magick convert output.png/* -delay " + inputGifDelay + " -loop 0 '" + outputSavePath +"'";
1080+
cmd = cmd + ";./magick convert -delay " + inputGifDelay + " output.png/* -loop 0 '" + outputSavePath +"'";
10811081
else
10821082
cmd = cmd + ";" + export_cmd;
10831083
} else {

0 commit comments

Comments
 (0)