Comments (11)
Sorry, I'm currently snowed under at work. I'll update it this Sunday.
On Mon, Mar 21, 2016 at 4:13 AM, hongxi [email protected] wrote:
any update on this?
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#3 (comment)
Khaled M. Taha
Kindly note that this is my personal email address, and it would be greatly
appreciated if this address remains free of any unauthorized mailing lists
and/or forwards.
from xanimatedimage.
You're absolutely right. I've already fixed this issue on a build that I currently have. I'll be pushing it out soon. I'll update you once that happens.
Thanks for the feedback and your help.
from xanimatedimage.
Bump
from xanimatedimage.
Any status update on this?
from xanimatedimage.
any update on this?
from xanimatedimage.
any update on this?
from xanimatedimage.
any update on this?
from xanimatedimage.
Thanks a lot, waiting for this so we can start adding cat gifs!!
from xanimatedimage.
Haha, this is top priority folks!
Jokes aside, I apologize for making y'all wait. Just a little longer.
On Mon, Mar 21, 2016 at 1:24 PM, John Rickman [email protected]
wrote:
Thanks a lot, waiting for this so we can start adding cat gifs!!
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#3 (comment)
Khaled M. Taha
Kindly note that this is my personal email address, and it would be greatly
appreciated if this address remains free of any unauthorized mailing lists
and/or forwards.
from xanimatedimage.
Currently working on it, this has already been resolved as part of FLAnimatedImage. I'm adding this function:
func loadAnimatedImageWithURL(url:NSURL, completion:(animatedImage:XAnimatedImage)-> ()) {
// Create a file to store the GIF and its corresponding data
let fileName = url.lastPathComponent!
let diskPath = (NSHomeDirectory() as NSString).stringByAppendingPathComponent(fileName)
var animatedImageData = NSFileManager.defaultManager().contentsAtPath(diskPath)
var animatedImage = XAnimatedImage()
if animatedImageData?.bytes == nil {
// Newly created, then download
NSURLSession.sharedSession().dataTaskWithURL(url) { (data:NSData?, response:NSURLResponse?, error:NSError?) -> Void in
if error == nil {
animatedImageData = data
animatedImage = XAnimatedImage(initWithAnimatedGIFData: animatedImageData!)
if let _ = animatedImage.posterImage {
dispatch_async(dispatch_get_main_queue(), { () -> Void in
completion(animatedImage: animatedImage)
})
data?.writeToFile(diskPath, atomically: true)
}
} else {
print("error exists")
}
} .resume()
} else {
animatedImage = XAnimatedImage(initWithAnimatedGIFData: animatedImageData!)
completion(animatedImage: animatedImage)
}
}`
Currently called within the func viewDidLoad() as such:
let urlString = "https://i.imgur.com/8W2mtHB.gif"
let url = NSURL(string: urlString)
self.loadAnimatedImageWithURL(url!) { (animatedImage) -> () in
self.animatedImageA = animatedImage
self.animatedImageViewA.animatedImage = self.animatedImageA
self.animatedImageA.debug_delegate = self.debugViewA
self.animatedImageViewA.debug_delegate = self.debugViewA
self.debugViewA.image = self.animatedImageA
}
It seems to work. But I'm still testing. Thought to give y'all an update.
from xanimatedimage.
Let me know if this fixes the issue.
from xanimatedimage.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xanimatedimage.