You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/12/13 16:25:14 UTC

[GitHub] [cordova-android] PieterVanPoyer commented on a change in pull request #1113: Features/webp support for splashscreen

PieterVanPoyer commented on a change in pull request #1113:
URL: https://github.com/apache/cordova-android/pull/1113#discussion_r541957234



##########
File path: bin/templates/cordova/lib/prepare.js
##########
@@ -317,28 +318,13 @@ function getAdaptiveImageResourcePath (resourcesDir, type, density, name, source
     return resourcePath;
 }
 
-/**
- * The splashScreenSrc is a .webp image or a .png (or .jpg) image.
- * An inputted .webp should be copied to a screen.webp file.
- * An inputted .png (or .jpg) should be copied to a screen.png file.
- *
- * When a splashscreen is changed from a .png to a .webp or the other way round,
- * the other image must be deleted, to avoid a duplicate resource exception.
- *
- * @param splashScreenSrc
- * @returns {{splashScreenDestToRemove: string, splashScreenDest: string}}
- */
-function buildSplashScreenImageToCopyAndToRemove (splashScreenSrc) {
-    if (path.extname(splashScreenSrc) === '.webp') {
-        return {
-            splashScreenDest: 'screen.webp',
-            splashScreenDestToRemove: 'screen.png'
-        };
-    }
-    return {
-        splashScreenDest: 'screen.png',
-        splashScreenDestToRemove: 'screen.webp'
-    };
+function makeSplashCleanupMap (projectRoot, resourcesDir) {
+    // Build an initial resource map that deletes all existing splash screens
+    const existingSplashPaths = glob.sync(

Review comment:
       Seems like a forward and backwards slash problem in my tests. The resourcesDir is with backward slashes, but should be with forward slashes.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org