GithubHelp home page GithubHelp logo

flanimatedimage's People

Contributors

bennie-atlassian avatar caughtinflux avatar chrismash avatar cjcaufield avatar cybertk avatar danielamitay avatar delannoyk avatar dreampiggy avatar ejensen avatar elfsundae avatar jnavarrom avatar kean avatar matrush avatar michafaw avatar mopsled avatar nikolaisa avatar nolanw avatar pennig avatar prayagverma avatar pronebird avatar raphaelschaad avatar remylivewall avatar ryanolsonk avatar simurai avatar timonus avatar vinibaggio avatar xiles avatar yetanotherrzmn avatar zkrige avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flanimatedimage's Issues

Make loopCount writable so one can set the animation loop count

Hey guys,

first of all great library! I have the scenario where I want to be able to animate a GIF only once but I don't want to modify the GIF because on other places I do want the infinitive loop.

I found the loopCount property on FLAnimatedImage which when I modify the readonly flag and set it to 1 gives me exactly the outcome I want.

Is it possible to make it writable without me having to fork it?

GIF don't seem to animate on iOS 7

I'm using the FLAnimatedImage and it doesn't seem like the gif is getting animated. I'm using a local gif like so:

FLAnimatedImage *image =
        [[FLAnimatedImage alloc] initWithAnimatedGIFData:[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:filename ofType:@"gif"]]];

    self.testImageView.animatedImage = image;

No issue whatsoever on iOS 8 but I can't get the GIF to animate on iOS7. I tried with startAnimating but that does not seem to help (plus it seems like it's not necessary).

FLAnimatedImageView goes black on receiving a touch inside a collection view cell

Any FLAnimatedImageView instances that are placed in a collection view cell's content view seem go black on receiving a touch. On recreating the cell (via scrolling the cell out-of and back into view again), it no longer goes black on receiving a touch. I am adding the FLAnimatedImageView to the cell's contentView using IB, for what its worth.

prevent creation of _UIAnimatedImage

I know that this is probably unrelated to FLAnimatedImage, but I thought you might be able to help me out. I'm downloading gifs from the network, and they have a large file size, so I just want them to be plain old UIImage that take up minimum RAM.

What's happening though is that I'm getting _UIAnimatedImage in the imageview which are presumably being animated by the system (I'm using an FLAnimatedImageView). This baloons up memory usage(>500MB), causing my app to crash.

Do you have any pointers as to how to disable either the creation of _UIAnimatedImage or stopping the animation? Any methods I can set a break point on to track this? Thanks. (FWIW, SDWebImage is responsible for creating UIImages out of network data.)

Happy to provide more info.

Please can anyone help me?

I'm trying to use FLAnimatedImage to show 84 gif in collection view. But i can't do this my app perfect work in simulator but doesn't work on real device. I had next code:
const int NUMBER_OF_GIFS = 84;
@Property (strong, nonatomic) FLAnimatedImage *gifImage;

            for (int i = 0; i < NUMBER_OF_GIFS; i++) {
                self.gifImage = [[FLAnimatedImage alloc] initWithAnimatedGIFData:[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%i", i] ofType:@"gif"]]];

         [self.gifsArray addObject:self.gifImage];
         self.gifImage = nil;
     }
  • (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
    {
    CellForGif *cellForGif = [collectionView dequeueReusableCellWithReuseIdentifier:@"CellForGif" forIndexPath:indexPath];
    cellForGif.gifImage.animatedImage = [self.gifsArray objectAtIndex:indexPath.row];
    [cellForGif.gifImage stopAnimating];
    return cellForGif;
    }

delayTime rounding

It doesn't seem to support the minimum delayTime. That's probably due to float and double comparison, even though wrapped in NSNumber.

Verbose: Rounding frame 183's `delayTime` from 0.020000 up to default 0.100000 (minimum supported: 0.020000).

Jump to frame

Is there a way to jump to a specific frame of a GIF? This would be a huge help when trying to sync two views with the same GIF.

Implement Unit Tests

Hey Guys, I'll be working on giving you guys some unit tests at the test jam today.

Can I detect corrupt GIF file?

Sometime a GIF image not play till the end. I don't sure what is the cause of this problem. Is there any way I can detect corrupted/incomplted GIF file?

Move to #import single header

Currently both headers, FLAnimatedImage.h and FLAnimatedImageView.h need to be imported. It seems it would make sense to just make it one.

Crash on dealloc on animating image

Here at Medium we are using FLAnimatedImage for a project and we've seeing crashers that you might be experiencing as well.

This is the stack:

Thread : Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x37c8b8e0 _objc_trap() + 18446744073709552000
1  libobjc.A.dylib                0x37c8b945 _objc_inform
2  libobjc.A.dylib                0x37c9a3c7 weak_register_no_lock + 182
3  libobjc.A.dylib                0x37c9a6ff objc_storeWeak + 110
4  ooooooo                        0x00229297 +[FLWeakProxy weakProxyForObject:]
5  ooooooo                        0x00229549 -[FLAnimatedImageView displayLink]
6  ooooooo                        0x002298c7 -[FLAnimatedImageView stopAnimating]
7  UIKit                          0x2fd5db09 -[UIImageView dealloc] + 64
8  ooooooo                        0x00229651 -[FLAnimatedImageView dealloc]
9  ooooooo                        0x0016d05d -[MDImageView dealloc]
10 libdispatch.dylib              0x3817381f _dispatch_client_callout
11 libdispatch.dylib              0x3817a49f _dispatch_main_queue_callback_4CF$VARIANT$mp
12 CoreFoundation                 0x2d50b8f1 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
13 CoreFoundation                 0x2d50a1c5 __CFRunLoopRun + 1300
14 CoreFoundation                 0x2d474f0f CFRunLoopRunSpecific + 522
15 CoreFoundation                 0x2d474cf3 CFRunLoopRunInMode + 106
16 GraphicsServices               0x32396663 GSEventRunModal
17 UIKit                          0x2fdc016d UIApplicationMain + 1136
18 ooooooo                        0x000bdef3 main (main.m:20)

I suspect that the call that UIImageView's dealloc to stopAnimating is unexpected. What ends up happening is that, on stopAnimating, displayLink tries to be recreated. I don't fully understand what this implies and results in a crash, but maybe there's a way to stop this from happening.

Also I am happy to contribute on a fix to this, but I'd rather have pointers from the authors of the library as to what you think it's the best approach to fix this.

Thanks!

Bring demo app to iOS 6

FLAnimatedImage supports iOS 6+ but the demo player is at 7+ because of some adjustments that need to happen before lowering the deployment target.

See previous (closed) issue: #7

Undefined symbols for architecture x86_64

Hi,
I'm getting the following error while building.

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_DDLog", referenced from:
      objc-class-ref in FLAnimatedImage.o
      objc-class-ref in FLAnimatedImageView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm sure that the solution is easy but, for the life of me, can't figure out the solution.
Any help is welcome!
Thanks!

Animaton Rewind

Is there anyway to detect when the animation has ended AFTER it has gone to the end and THEN gone backwards back to the start?

Animation Reset?

Is there a way to reset an animation back to frame 0 programmatically? Or better yet a way to load the image in a non-animated state?

clear background

If my gif have a clear background how can I make FLAnimatedImage to load it?

I'm using this:

convenience init(gifResource: String) { let imagePath = NSBundle.mainBundle().pathForResource(gifResource, ofType: "gif") self.init(animatedGIFData: NSData(contentsOfFile: imagePath!)) }

investigate using GPU for image decoding

This is a great tool for apps that heavily use GIF's but CPU use is high when caching is limited to a few frames. This is due to the decoding of the images on demand which is performed by the CPU as I understand. It'd be great it if we could use the GPU instead. Have you looked into this?

Support reverse playback

We could support reverse playback on the view-level. The API could be:

@property (nonatomic, assign) BOOL shouldPlayReverse; // Can be changed during playback; default is NO

(Compare AVPlayerItem's canPlayReverse API.)

The data provider (image) would have know about it and reverse all it's internal caching logic too. To know about it, we could extend the method -imageLazilyCachedAtIndex: to include a BOOL.

Maybe it's also time to add a tighter coupling/delegate from image -> to view so the data provider has a better understanding of the view(s) that are displaying its frames. This could be an approach to fix Multiple image views referencing the same image cause loading to malfunction #33 too.

speed change

Is there a way to change Gif Speed?
For example, change value of UISlider , gif speed changes.

I tried to change animationDuration.FLAnimatedImageView, but did not work well.

Xamarin/mono wrapper

More of a feature request than issue, but it would be great if someone with the know how would create a mono wrapper for this to decrease the barrier to entry even further.

Allow tracking arbitrary debugging data for any instance of `FLAnimatedImage`

We used to have properties like

@property (nonatomic, strong) NSURL *debugOriginalURL;
...

etc. to track certain debugging data.

I'm thinking just one NSDictionary like

@property (nonatomic, strong) NSDictionary *debug_info;

and leave it up to the "client classes" (e.g. image loading operations) to define keys and store/query the value, should do it.

Failed to compile project when project uses CocoaLumberjack

We use CocoaLumberjack in Medium's app and we declare ddLogLevel as:
extern int ddLogLevel;

The project now fails with the following error:

/workspace/Pods/Headers/Public/FLAnimatedImage/FLAnimatedImage.h:115:22: redefinition of 'ddLogLevel' with a different type: 'const int' vs 'int'

    extern const int ddLogLevel;

What do you think?

Overly verbose logging in FLAnimatedImageView

Seeing this in our app, seems like the debug log could be inside of the debug conditional block?

In:

https://github.com/Flipboard/FLAnimatedImage/blob/master/FLAnimatedImageDemo/FLAnimatedImage/FLAnimatedImageView.m#L273

image

2015-06-09 13:52:15:996 MyApp[58268:607] Waiting for frame 1 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:16:012 MyApp[58268:607] Waiting for frame 1 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:16:112 MyApp[58268:607] Waiting for frame 2 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:16:213 MyApp[58268:607] Waiting for frame 3 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:16:312 MyApp[58268:607] Waiting for frame 4 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:16:396 MyApp[58268:607] Waiting for frame 5 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:16:495 MyApp[58268:607] Waiting for frame 6 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:16:596 MyApp[58268:607] Waiting for frame 7 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:16:696 MyApp[58268:607] Waiting for frame 8 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:16:796 MyApp[58268:607] Waiting for frame 9 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:16:879 MyApp[58268:607] Waiting for frame 10 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:16:979 MyApp[58268:607] Waiting for frame 11 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:17:093 MyApp[58268:607] Waiting for frame 12 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:17:106 MyApp[58268:607] Waiting for frame 12 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:17:196 MyApp[58268:607] Waiting for frame 13 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:17:296 MyApp[58268:607] Waiting for frame 14 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:17:379 MyApp[58268:607] Waiting for frame 15 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:17:479 MyApp[58268:607] Waiting for frame 16 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:17:579 MyApp[58268:607] Waiting for frame 17 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:18:520 MyApp[58268:607] Waiting for frame 18 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:18:620 MyApp[58268:607] Waiting for frame 19 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:18:704 MyApp[58268:607] Waiting for frame 20 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:18:804 MyApp[58268:607] Waiting for frame 21 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48
2015-06-09 13:52:18:904 MyApp[58268:607] Waiting for frame 22 for animated image: <FLAnimatedImage: 0x7fb201d701a0> size={640, 1136} frameCount=48

Bring demo app to iOS 5 and 6

FLAnimatedImage fully supports iOS 5 and 6 but the demo player doesn't, because of simple UI and sample project customization that needs to get done before lowering the deployment target.

Multiple image views referencing the same image cause loading to malfunction

See this branch: https://github.com/tijoinc/FLAnimatedImage/tree/mutiple-views-same-image

If you create multiple instances of FLAnimatedImageView that refer to the same instance of FLAnimatedImage loading stutters and stops.

issue

The image loading methods within FLAnimatedImage are intended to only be loading frames for a single image view at a time, would be good to loosen this. The best approach I can think of is to move the image loading/preloading logic into FLAnimatedImageView itself and have FLAnimatedImage simply serve up frames as requested.

A stopgap solution is to make FLAnimatedImage conform to NSCopying and give the copy attribute to FLAnimatedImageView's animatedImage property.

Continue Playing Even During Animation

Looked through the project and comments where I thought I'd find something, but I've been unable to find anything that explains why the GIFs are paused during an animation. This is the only flaw with the class as far as I can tell, everything else works perfectly.

Please can anyone explain me.

I create a breakpoint in FLAnimatedImage in

  • (void)didReceiveMemoryWarning:(NSNotification *)notification
    and when I start my app I always go to this method many times. Is it incorrect?

Help with Swift

Ok, first I have my Gif in storyboard and I have the IBOutlet like this in my view:

@IBOutlet weak var imageGIF: FLAnimatedImageView!

But i'm receiving an error of NSUnknownKeyException: this class is not key value coding-compilant for the key imageGIF.

And second, how can I play any GIF in Swift? I'm kinda stuck in this for like a week.

crash when setAnimatedImage involved

Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xbf00bdf0
getMethodNoSuper_nolock(objc_class_, objc_selector_) + 23
CFRelease + 560
_CGImagePlusFinalize + 120
CFRelease + 466
CFRelease + 466
_CGImageSourceFinalize + 134

CFRelease + 466

FLAnimatedImage.m line 316
-[FLAnimatedImage dealloc]

objc_object::sidetable_release(bool) + 174

FLAnimatedImageView.m line 62
-[FLAnimatedImageView setAnimatedImage:]

imageLazilyCachedAtIndex problem

Hi @raphaelschaad !

I'm trying to retrieve all the images of a gif, howerver this only works when the size of the gif is less than 1.5 mb. Is that normal ?

If yes, do you another way to retrieve all the images of a gif ?

Thank you :)

Make FLAnimatedImage into a UIImage subclass

Current image caches generally return objects of a single type, like UIImage or NSImage. It's hard to plug FLAnimatedImage into existing caches because objects of different classes will have to be returned and type checked.

It's a bit of work, but inheriting from UIImage and overriding all the default initializers would also make the API easier to adopt, though this could be done without subclassing.

Speed of GIF decrease when it is placed on SKScene.

Hi,
I am using FLAnimatedImage in my game.
It is really nice.

But when i place this gif over SpriteKit's SKScene , unfortunately speed of my gif was decreased.
Same "FLAnimatedImage" object give different effect when it place over UIVIEW & it place over SKScene.
When it place over UIVIEW it gives normal effect but when it placed over SKScene it becomes very slew.

Any suggestions will be appreciated.

Error with 2.0.0-beta3 and CocoaLumberjack integration

When I create a project that contains both FLAnimatedImage 1.0.3 and CocoaLumberjack 2.0.0-beta3, I get the following linker error:

Undefined symbols for architecture x86_64:
  "_ddLogLevel", referenced from:
      -[FLAnimatedImageView displayDidRefresh:] in libPods-testapp-FLAnimatedImage.a(FLAnimatedImageView.o)
      +[FLAnimatedImage initialize] in libPods-testapp-FLAnimatedImage.a(FLAnimatedImage.o)
      -[FLAnimatedImage init] in libPods-testapp-FLAnimatedImage.a(FLAnimatedImage.o)
      -[FLAnimatedImage initWithAnimatedGIFData:] in libPods-testapp-FLAnimatedImage.a(FLAnimatedImage.o)
      -[FLAnimatedImage imageLazilyCachedAtIndex:] in libPods-testapp-FLAnimatedImage.a(FLAnimatedImage.o)
      -[FLAnimatedImage addFrameIndexesToCache:] in libPods-testapp-FLAnimatedImage.a(FLAnimatedImage.o)
      ___42-[FLAnimatedImage addFrameIndexesToCache:]_block_invoke_2 in libPods-testapp-FLAnimatedImage.a(FLAnimatedImage.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm also seeing it with CocoaLumberjack 1.9.x. I can replicate this by creating an empty project with just those two pods added.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.