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



##########
File path: bin/templates/cordova/lib/prepare.js
##########
@@ -336,15 +336,27 @@ function updateSplashes (cordovaProject, 
platformResourcesDir) {
         if (resource.density === 'mdpi') {
             hadMdpi = true;
         }
-        var targetPath = getImageResourcePath(
-            platformResourcesDir, 'drawable', resource.density, 'screen.png', 
path.basename(resource.src));
+        var targetPath;
+        if (path.extname(resource.src) === '.webp') { // splashsreens could be 
in .webp format
+            targetPath = getImageResourcePath(
+                platformResourcesDir, 'drawable', resource.density, 
'screen.webp', path.basename(resource.src));
+        } else {
+            targetPath = getImageResourcePath(
+                platformResourcesDir, 'drawable', resource.density, 
'screen.png', path.basename(resource.src));
+        }

Review comment:
       ```suggestion
           const imgDestExt = path.extname(resource.src) === '.webp' ? '.webp' 
: '.png';
           const imgDestName = `screen${imgExt}`;
           const targetPath = getImageResourcePath(platformResourcesDir, 
'drawable', resource.density, imgDestName, path.basename(resource.src));
   ```




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to