Cannot load images of an animated image as jpeg onto apple watch cache
| Originator: | peter | ||
| Number: | rdar://20839855 | Date Originated: | 06-May-2015 11:22 AM |
| Status: | Open | Resolved: | |
| Product: | Apple Watch | Product Version: | Latest |
| Classification: | Bug | Reproducible: | Always |
Summary: I would like to send the frames of an animated image as jpeg to save space. The documentation says "To cache images for an animation, cache the entire animation as a single UIImage object and then convert that image to an NSData object. You can create such an image object using the animatedImageWithImages:duration: method." so it seems that I should be able to do this. However UIImageJPEGRepresentation does not render data for an animated image. I have also tried to cache the frames individually and that did not work. Here is a gist for example code. https://gist.github.com/datinc/3c671cbc2a04fd395122 Steps to Reproduce: UIImage* animatedImage = [UIImage animatedImageWithImages:images duration:0.4]; NSData* data = UIImageJPEGRepresentation(animatedImage, 0.3); UIImage* image = [UIImage imageWithData:data]; NSLog(@"%ld should equal %ld", (long)animatedImage.images.count, (long)image.images.count); [[WKInterfaceDevice currentDevice] addCachedImageWithData:data name:@"image"] ... [self.wkimage setImageNamed:@"image"]; [self.wkimage startAnimating]; Expected Results: Animated images are jpeg Actual Results: UIImage is not serializes to include animation. Version: Latest Notes: Configuration: Apple Watch Attachments:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!