Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix that CGImageDestinationCreateWithData 0 count arg will log a warning #2739

Merged

Conversation

dreampiggy
Copy link
Contributor

New Pull Request Checklist

  • I have read and understood the CONTRIBUTING guide

  • I have read the Documentation

  • I have searched for a similar pull request in the project and found none

  • I have updated this branch with the latest master to avoid conflicts (via merge from master or rebase)

  • I have added the required tests to prove the fix/feature I am adding

  • I have updated the documentation (if necessary)

  • I have run the tests and they pass

  • I have run the lint and it passes (pod lib lint)

This merge request fixes / refers to the following issues: #2738

Pull Request Description

See #2738. This log is from Image/IO, when the CGImageDestinationCreateWithData count arg is passed with 0 instead of 1.

2019-05-29 12:47:41.447767+0800 SDWebImage iOS Demo[33116:4568883] CGImageDestinationCreateWithData:3088: *** ERROR: CGImageDestinationCreateWithData: invalid capacity (0)

The warning seems from iOS 12+, but sadly, our Test scheme, and Example, disable the NSLog function totally. So this does not catch any attention during development. I'll suggest to remove those OS_ACTIVITY_MODE = disable in another PR.

…rning, this does not effect the encoding function.
@dreampiggy dreampiggy added the fix label May 29, 2019
@dreampiggy dreampiggy added this to the 5.0.4 milestone May 29, 2019
@dreampiggy dreampiggy added this to In progress in Issue List May 29, 2019
@codecov
Copy link

codecov bot commented May 29, 2019

Codecov Report

Merging #2739 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2739      +/-   ##
==========================================
- Coverage   84.04%   84.02%   -0.03%     
==========================================
  Files          56       56              
  Lines        6225     6227       +2     
==========================================
  Hits         5232     5232              
- Misses        993      995       +2
Flag Coverage Δ
#ios 84.81% <100%> (-0.2%) ⬇️
#macos 83.03% <100%> (+0.37%) ⬆️
Impacted Files Coverage Δ
SDWebImage/SDImageAPNGCoder.m 88.13% <100%> (+0.05%) ⬆️
SDWebImage/SDImageGIFCoder.m 89.43% <100%> (+0.04%) ⬆️
SDWebImage/SDWebImageManager.m 85.65% <0%> (-0.82%) ⬇️
SDWebImage/SDWebImageDownloader.m 80.83% <0%> (-0.3%) ⬇️
SDWebImage/SDWebImageDownloaderOperation.m 91.41% <0%> (+0.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51fc2e8...e1b4e5a. Read the comment docs.

Copy link
Member

@kinarobin kinarobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If animatedImage's imageFrame count is 0, Just as static image encode, This logic is OK.

@dreampiggy dreampiggy merged commit 0e255db into SDWebImage:master May 29, 2019
Issue List automation moved this from In progress to Done May 29, 2019
@dreampiggy dreampiggy deleted the fix_encoding_imageio_warning branch May 29, 2019 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Issue List
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants