Skip to content

Commit

Permalink
Only populate app extensions if infinite loop is true
Browse files Browse the repository at this point in the history
  • Loading branch information
sksamuel committed Sep 17, 2023
1 parent 993098f commit 353f856
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -73,7 +73,8 @@ public byte[] bytes(ImmutableImage[] images) throws IOException {
IIOMetadataNode root = (IIOMetadataNode) imageMetaData.getAsTree(metaFormatName);
populateGraphicsControlNode(root, Duration.ofMillis(frameDelayMillis));
populateCommentsNode(root);
populateApplicationExtensions(root, infiniteLoop);
if (infiniteLoop)
populateApplicationExtensions(root, infiniteLoop);

imageMetaData.setFromTree(metaFormatName, root);

Expand Down
Expand Up @@ -107,7 +107,8 @@ public GifStream prepareStream(OutputStream output, int imageType) throws IOExce
IIOMetadataNode root = (IIOMetadataNode) imageMetaData.getAsTree(metaFormatName);
populateGraphicsControlNode(root, frameDelay);
populateCommentsNode(root);
populateApplicationExtensions(root, infiniteLoop);
if (infiniteLoop)
populateApplicationExtensions(root, infiniteLoop);

imageMetaData.setFromTree(metaFormatName, root);

Expand Down

0 comments on commit 353f856

Please sign in to comment.