alexiscreuzot / SwiftyGif

High performance GIF engine
MIT License
2.02k stars 212 forks source link

Applying scale on remote GIFs #152

Closed motasay closed 1 year ago

motasay commented 3 years ago

This is related to #122 #2 but not quite the same. This is how I'm using the library now to show GIFs downloaded remotely:

url = URL(string: "http://domain.com/gifs/example.gif")!
let data = try Data(contentsOf: url)
let gif = try UIImage(imageData: data)!
let imageView = UIImageView(gifImage: gif)

Is there anyway I can specify the scale of the gif in the library? Something like:

let scale = 2
url = URL(string: "http://domain.com/gifs/example@\(scale)x.gif")!
let data = try Data(contentsOf: url)
let gif = try UIImage(imageData: data, scale: scale)!

I can create a pull request if someone can give me some pointers.