-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Features/webp support for splashscreen #1113
Features/webp support for splashscreen #1113
Conversation
Could you also test if .jpg splashscreen do work? It's stated in the docs, but it seems like that there is a hardcoded check to |
Codecov Report
@@ Coverage Diff @@
## master #1113 +/- ##
==========================================
+ Coverage 69.71% 71.80% +2.09%
==========================================
Files 20 21 +1
Lines 1806 1745 -61
==========================================
- Hits 1259 1253 -6
+ Misses 547 492 -55
Continue to review full report at Codecov.
|
@timbru31 Hey I did test the .jpg flow. Really odd, but it works. So what happens, the .jpg is saved as a screen.png in the android project. But android is just displaying it nice. A testrepo is available at: https://github.com/PieterVanPoyer/cordova-plugin-splashscreen-testing-app/tree/testing/jpg-splash-screen |
- platform independent paths in testing - addes some unittest - remove duplication + add comments - delete webp's if png's added, delete png's if webp' added. - Update bin/templates/cordova/lib/prepare.js Co-authored-by: エリス <[email protected]> - fix apache/cordova-plugin-splashscreen#257 webp support for android
76f439f
to
e778854
Compare
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.
Looks good to me.
Tested it on one of my apps 👍
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.
I only had the time to take a quick look at this. It is great that we have test coverage for this feature and the code looks clean 👍
However, I can't help to think that it is not optimal that we have to hard-code the handling of a specific set of extensions into the core platform to implement a plugin feature.
So can someone shed some light on why we have the splash-screen logic here in the first place?
And could we at least implement this in a more generic way? Something more like
delete $dest/screen.*
copy $splashImg $dest/$splashImg
Hi @raphinesse thanks for your time. I was also happy with the testcoverage. There were some examples and it was easy to just add my stuff and improve the coverage. And like you said: 'the code is clean'. I must admit, when I was looking for fixing the issue, I was surprised to find the handling of the splashscreens in the cordova-android lib and not in the plugin code. Unfortunately I cannot shed any light on that matter. I think making this stuff more generic wouldn't be a real improvement, and I don't exactly know how you'd like that to be. Kind regards |
Actually, it seems that we have plans to move things in the opposite direction. Sorry, I did not remember that. I don't know why this functionality should be moved from plugin to platform, but there is probably a good reason. So the platform seems indeed like the right location for these changes. I'll get back to you regarding a more generic way to implement this. |
@PieterVanPoyer FYI: I made a pull request (PieterVanPoyer#1) against this branch |
…hscreen Features/webp support for splashscreen
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.
LGTM now. Thanks a lot for testing and fixing my changes @PieterVanPoyer !
Thank you for the review @raphinesse Our current dev version is targeting a minor release so I'll go ahead and merge this. Thank you @PieterVanPoyer for your time and effort in preparing this PR! |
@breautek thanks for the effort. Maybe I should make an issue in the Cordova Docs repo, to add some info about the webp - support to the docs? |
Platforms affected
Android
Motivation and Context
A splashscreen image on Android can be in a webp format. ( https://developer.android.com/studio/write/convert-webp )
When a webp image is included the build breaks.
Description
If the inputted splash screen has a .webp extension, it is saved to the correct density folder as screen.webp.
An possible old screen.png of the same folder is deleted.
If the inputted splash screen has another extension (png or jpg), it is saved to the correct density folder as screen.png.
An possible old screen.webp of the same folder is deleted.
If android encouters a webp and a png with the same name and density a compilation error is thrown by Android
Testing
Todo
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)