Skip to content

Commit 4361474

Browse files
committed
R store parameters to fields
1 parent 0a699bd commit 4361474

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

approvaltests/src/main/java/org/approvaltests/awt/GifSequenceWriter.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
public class GifSequenceWriter implements AutoCloseable
3434
{
35+
private final int imageType;
36+
private final boolean loopContinuously;
3537
protected ImageWriter gifWriter;
3638
protected ImageWriteParam imageWriteParam;
3739
protected IIOMetadata imageMetaData;
@@ -49,16 +51,16 @@ public class GifSequenceWriter implements AutoCloseable
4951
public GifSequenceWriter(ImageOutputStream outputStream, int imageType, Duration timeBetweenFramesMS,
5052
boolean loopContinuously) throws IIOException, IOException
5153
{
54+
this.imageType = imageType;
55+
this.loopContinuously = loopContinuously;
5256
// my method to create a writer
5357
gifWriter = getWriter();
5458
imageWriteParam = gifWriter.getDefaultWriteParam();
55-
IIOMetadata imageMetaData2 = getMetadata(imageType, timeBetweenFramesMS, loopContinuously);
56-
imageMetaData = imageMetaData2;
59+
imageMetaData = getMetadata(timeBetweenFramesMS);
5760
gifWriter.setOutput(outputStream);
5861
gifWriter.prepareWriteSequence(null);
5962
}
60-
private IIOMetadata getMetadata(int imageType, Duration timeBetweenFramesMS, boolean loopContinuously)
61-
throws IIOInvalidTreeException
63+
private IIOMetadata getMetadata(Duration timeBetweenFramesMS) throws IIOInvalidTreeException
6264
{
6365
ImageTypeSpecifier imageTypeSpecifier = ImageTypeSpecifier.createFromBufferedImageType(imageType);
6466
IIOMetadata imageMetaData2 = gifWriter.getDefaultImageMetadata(imageTypeSpecifier, imageWriteParam);

0 commit comments

Comments
 (0)