Git Product home page Git Product logo

Comments (11)

khaledmtaha avatar khaledmtaha commented on July 21, 2024 2

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.

khaledmtaha avatar khaledmtaha commented on July 21, 2024

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.

johnrickman avatar johnrickman commented on July 21, 2024

Bump

from xanimatedimage.

johnrickman avatar johnrickman commented on July 21, 2024

Any status update on this?

from xanimatedimage.

mpc20001 avatar mpc20001 commented on July 21, 2024

any update on this?

from xanimatedimage.

MMasterson avatar MMasterson commented on July 21, 2024

any update on this?

from xanimatedimage.

chx632996066 avatar chx632996066 commented on July 21, 2024

any update on this?

from xanimatedimage.

johnrickman avatar johnrickman commented on July 21, 2024

Thanks a lot, waiting for this so we can start adding cat gifs!!

from xanimatedimage.

khaledmtaha avatar khaledmtaha commented on July 21, 2024

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.

khaledmtaha avatar khaledmtaha commented on July 21, 2024

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.

khaledmtaha avatar khaledmtaha commented on July 21, 2024

Let me know if this fixes the issue.

from xanimatedimage.

Related Issues (5)

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.