SnehaK
SnehaK

Reputation: 151

Changes in imageWithCGImage:scale:orientation api ios13 with respect to gif images

I am using some custom code to render gif in UIImageView. Below is the link for the code used

https://github.com/swiftgif/SwiftGif/blob/master/SwiftGifCommon/UIImage%2BGif.swift

I have changed the code a bit to respect scale for different resolution devices. Below is the code.

    frame = UIImage(cgImage: images[Int(index)], scale: UIScreen.main.scale, orientation: .up)

Till iOS12 this was working fine and the image got scaled and down scaled based on device. From iOS13, if @2x, @3x images are used, then they are getting scaled and also scale is not being respected.

Tried few other gif rendering techniques on iOS, but no use. Can anyone suggest what's happening with the api, if they have encountered the same problem.

Upvotes: 0

Views: 55

Answers (1)

SnehaK
SnehaK

Reputation: 151

This issue got resolved when I set array of images directly to "animatedImages" property rather than creating UIImage using "[UIImage animatedImageWithImages:frames duration:(NSTimeInterval)]" api.

Upvotes: 0

Related Questions