SDWebImage / SDWebImage/SDWebImageWebPCoder

Frames loading

Open
#105 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C
Stars
277
Forks
101
PR merge metrics
No merged PRs in 30d

Description

Hello, I'm trying to use animated webp images as cells for collection view and it works nice on new devices, but on devices like iPhone 7 I have such an issue: on first appearing of cell the loading of images is freezed, and scrolling is not (I can scroll the collection without freezes, so it is not main thread lock). There are approximately 50 cells of images, and they loads by frame. After some time (I guess when all frames of images are passed) all cells begin to animate correctly (after closing and reopening the screen too). Looks like it is something connected with caching. All webp-s are local files, so it is not network loading. Am doing something wrong? Here is the code:

SDWebImageManager.shared.optionsProcessor = SDWebImageOptionsProcessor { _, options, context in
    var mutableOptions = options
    mutableOptions.insert([.retryFailed, .highPriority/*, .preloadAllFrames*/]) // no efffect on frames loading

    return SDWebImageOptionsResult(options: mutableOptions, context: context)
}

SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)
SDWebImageDownloader.shared.setValue("image/webp,image/*,*/*;q=0.8", forHTTPHeaderField: "Accept")

...

var stickerImageView = SDAnimatedImageView(frame: .zero)
// stickerImageView.shouldIncrementalLoad = true // no efffect on frames loading
stickerImageView.sd_imageTransition = .fade(duration: 0.3)

...
stickerImageView.sd_setImage(with: url, placeholderImage: placeholder)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the animated WebP collection-view case with SDAnimatedImageView, SDWebImageManager, and SDImageCodersManager on an older iOS device or equivalent environment. Compare first appearance with later animation after the local images have been processed or cached. Done means the approximately 50 local animated WebP cells begin loading and animating correctly without the reported initial freeze.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c, swift
Domain
mobile, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.