Skip to content

Commit a528b3b

Browse files
committed
gpujpegtool: do not print image save info if fail
1 parent 6cea97e commit a528b3b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,12 +637,12 @@ main(int argc, char *argv[])
637637
gpujpeg_image_save_to_file(output, image_compressed, image_compressed_size, &param_image) != 0 ) {
638638
fprintf(stderr, "Failed to save image [%s]!\n", argv[index]);
639639
ret = EXIT_FAILURE;
640+
} else {
641+
duration = gpujpeg_get_time() - duration;
642+
printf("Save Image: %10.4f ms\n", duration * 1000.0);
643+
printf("Image Name: %10s\n", output);
640644
}
641645

642-
duration = gpujpeg_get_time() - duration;
643-
printf("Save Image: %10.4f ms\n", duration * 1000.0);
644-
printf("Image Name: %10s\n", output);
645-
646646
// Destroy image
647647
gpujpeg_image_destroy(image);
648648
}

0 commit comments

Comments
 (0)