Permalink
Browse files

Fix gif not loop

  • Loading branch information...
1 parent 1605504 commit d45c56199d112b8295f124b26467d6d0894f2840 @onmyway133 committed Mar 6, 2017
Showing with 5 additions and 3 deletions.
  1. +5 −3 Pods/NSGIF/NSGIF/NSGIF.m
View
@@ -134,7 +134,10 @@ + (NSURL *)createGIFforTimePoints:(NSArray *)timePoints fromURL:(NSURL *)url fil
NSString *temporaryFile = [NSTemporaryDirectory() stringByAppendingString:fileName];
NSURL *fileURL = [NSURL fileURLWithPath:temporaryFile];
CGImageDestinationRef destination = CGImageDestinationCreateWithURL((__bridge CFURLRef)fileURL, kUTTypeGIF , frameCount, NULL);
-
+
+ // FIX: https://github.com/NSRare/NSGIF/pull/23/files
+ CGImageDestinationSetProperties(destination, (CFDictionaryRef)fileProperties);
+
if (fileURL == nil)
return nil;
@@ -173,8 +176,7 @@ + (NSURL *)createGIFforTimePoints:(NSArray *)timePoints fromURL:(NSURL *)url fil
CGImageRelease(imageRef);
}
CGImageRelease(previousImageRefCopy);
-
- CGImageDestinationSetProperties(destination, (CFDictionaryRef)fileProperties);
+
// Finalize the GIF
if (!CGImageDestinationFinalize(destination)) {
NSLog(@"Failed to finalize GIF destination: %@", error);

0 comments on commit d45c561

Please sign in to comment.