Add support for animated GIFs
Update ImageBanner to support animated GIFs. Animations rely on ANSI
cursor codes so don't work so well in an IDE. They do, however, work
when running the app from a terminal.
See also commit 47bc5e71ab
Closes gh-11118
This commit is contained in:
@@ -165,6 +165,17 @@ public class ImageBannerTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void printBannerWhenAnimatesShouldPrintAllFrames() throws Exception {
|
||||
AnsiOutput.setEnabled(AnsiOutput.Enabled.NEVER);
|
||||
String banner = printBanner("animated.gif");
|
||||
String[] lines = banner.split(NEW_LINE);
|
||||
int frames = 138;
|
||||
int linesPerFrame = 36;
|
||||
assertThat(banner).contains("\r");
|
||||
assertThat(lines.length).isEqualTo(frames * linesPerFrame - 1);
|
||||
}
|
||||
|
||||
private int getBannerHeight(String banner) {
|
||||
return banner.split(NEW_LINE).length - 3;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 878 KiB |
Reference in New Issue
Block a user