-
Notifications
You must be signed in to change notification settings - Fork 14
Refactoring & fix a bug & add tests to increase code coverage. #18
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #18 +/- ##
===========================================
+ Coverage 67.13% 86.01% +18.87%
===========================================
Files 4 6 +2
Lines 1494 1494
===========================================
+ Hits 1003 1285 +282
+ Misses 491 209 -282
Continue to review full report at Codecov.
|
Wait me for review... Does these method should be public APIs ? If not, you should move them into a private folder (for example, make folder strcuture looks
Modify Podspec and use
Update the Xcode's File Attribute and mark the
Update the |
Or I can do this myself after merging, since I'm more familiar with all these suck Package Manager :) |
Yeah,
Haha, thanks! I tried to do it myself... Could you check it? |
I think I can make ColorSpace.h and Conversion.h private, but tests became to fail because of it... How should I do? |
Because you access the private header outside framework. In the test case: You should use some tricks on the Test Case target, update the
I can merge it and check each Package Manager and Project Settings again, to avoid some extra issues. |
#import "avif/avif.h" | ||
#endif | ||
|
||
CGColorSpaceRef CreateColorSpaceMono(avifNclxColourPrimaries const colorPrimaries, avifNclxTransferCharacteristics const transferCharacteristics); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These C function share the global symbol, which may cause conflict. Can we add some prefix here, like AVIFCreateColorSpaceMono
? Or use SDCreateAVIFColorSpaceMono
this sounds better ?
And the visibility should be marked as __attribute__((visibility("hidden")))
.
The same applies to others C function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I renamed functions and added __attribute__((visibility("hidden")))
, _Nonnull
, _Nullable
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ledyba-z This final function name now is SDCreateAVIFCreateColorSpaceRGB
, note there are two Create
🤣
Can this be SDCreateAVIFColorSpaceRGB
? Or like SDCreateColorSpaceRGBAVIF
?
If we follows the Core Foundation Naming, the Create
words is important because this means the caller should call release
or free
the the function call result.
Actually I prefer the prefix one SDCreateAVIFXXXX
but not the suffix one SDCreateXXXXAVIF
, because it's more clear for the usage, like Apple's C funtion naming (they don't usually use suffix). But since this is a private API, actually it's OK...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! 😆
I missed two "Create" (it might be too long function names for me!)
I renamed the functions.
I see... thanks. > Core Foundation Naming
Thanks to approve! I will merge after CI passed. |
Hi.
I separate SDWebImageAVIFCoder.m to 3 files. And also, I write some new tests to increase code coverage. After that, I found a crash bug about ICC profile and fix it.
Could you take a look?