Skip to content

Commit b7c562d

Browse files
committed
Parent directories are now created before writing the gif file.
1 parent d788c8c commit b7c562d

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ public class Main {
102102

103103
# Versions
104104

105+
## 0.2.0
106+
107+
Parent directories are now created before writing the gif file.
108+
105109
## 0.1.0
106110

107111
Initial implementation

src/main/java/com/github/moaxcp/gifbuilder/AbstractGifSpec.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.awt.image.BufferedImage;
88
import java.io.FileOutputStream;
99
import java.io.IOException;
10+
import java.nio.file.Files;
1011
import java.nio.file.Path;
1112
import java.util.List;
1213
import java.util.concurrent.TimeUnit;
@@ -104,6 +105,7 @@ private CreateInfo init() {
104105
}
105106

106107
private void writeGif(CreateInfo createInfo) throws IOException {
108+
Files.createDirectories(file().getParent());
107109
try(var out = new FileOutputStream(file().toFile())) {
108110
var encoder = new GifEncoder(out, createInfo.maxWidth(), createInfo.maxHeight(), loop());
109111
for (var imageSpec : images()) {

0 commit comments

Comments
 (0)