Skip to content

Instantly share code, notes, and snippets.

@jamlfy
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save jamlfy/9866679 to your computer and use it in GitHub Desktop.

Select an option

Save jamlfy/9866679 to your computer and use it in GitHub Desktop.
Bueno a raiz, que Cordova no cambia el tama;o de la imagenes, para hacer el splash y los icons, he decido creadar un script en ImageMagick para que solo teniendo dos imagenes (Icono y el Slpash) se pueda crear y colocar los iconos y los splash.

Uso!

$ ls 
Myicon.png  Mysplash.png
$ conjure -version
Version: ImageMagick 6.6.9-7 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP   
$ conjure -icon Myicon.png -project MyProject splash.msl
    Platform | Size 
    *Android | 96x96 
     Android | 72x72 
     Android | 48x48 
     Android | 36x36 
       iOS   | 144x144 
       iOS   | 57x57 
       iOS   | 114x114 
       iOS   | 72x72 
$ conjure -splash Mysplash.png -project MyProject splash.msl
     Platform | Size 
     Android | 200x320 
     Android | 320x480 
     Android | 480x800 
     Android | 720x1280 
      * iOS  | 320x480 
       iOS   | 640x960 
       iOS   | 640x1136
$ tree -a  platforms/android/res/
platforms/android/res/
├── drawable
│   └── icon.png
├── drawable-hdpi
│   ├── ic_launcher.png
│   └── icon.png
├── drawable-ldpi
│   ├── ic_launcher.png
│   └── icon.png
├── drawable-mdpi
│   ├── ic_launcher.png
│   └── icon.png
├── drawable-xhdpi
│   ├── ic_launcher.png
│   └── icon.png
├── values
│   └── strings.xml
└── xml
    └── config.xml

7 directories, 11 files
<?xml version="1.0" encoding="UTF-8"?>
<image>
<read filename="%[icon]" />
<resize width="152" height="152" />
<write filename="icon/icon-152x152.png" />
<resize width="144" height="144" />
<write filename="icon/icon-144x144.png" />
<resize width="128" height="128" />
<write filename="icon/icon-128x128.png" />
<resize width="120" height="120" />
<write filename="icon/icon-120x120.png" />
<resize width="114" height="114" />
<write filename="icon/icon-114x114.png" />
<resize width="100" height="100" />
<write filename="icon/icon-100x100.png" />
<resize width="96" height="96" />
<write filename="icon/icon-96x96.png" />
<resize width="80" height="80" />
<write filename="icon/icon-80x80.png" />
<resize width="76" height="76" />
<write filename="icon/icon-76x76.png" />
<resize width="72" height="72" />
<write filename="icon/icon-72x72.png" />
<resize width="60" height="60" />
<write filename="icon/icon-60x60.png" />
<resize width="58" height="58" />
<write filename="icon/icon-58x58.png" />
<resize width="57" height="57" />
<write filename="icon/icon-57x57.png" />
<resize width="50" height="50" />
<write filename="icon/icon-50x50.png" />
<resize width="48" height="48" />
<write filename="icon/icon-48x48.png" />
<resize width="40" height="40" />
<write filename="icon/icon-40x40.png" />
<resize width="36" height="36" />
<write filename="icon/icon-36x36.png" />
<resize width="29" height="29" />
<write filename="icon/icon-29x29.png" />
</image>
<?xml version="1.0" encoding="UTF-8"?>
<image>
<!-- Andorid Splash -->
<read filename="%[splash]" />
<resize width="200" height="320" />
<print output=" Platform | Size \n" />
<print output=" Android | 200x320 \n" />
<write filename="platforms/android/res/drawable-ldpi/ic_launcher.png" />
<resize width="320" height="480" />
<print output=" Android | 480x320 \n" />
<write filename="platforms/android/res/drawable-mdpi/ic_launcher.png" />
<resize width="480" height="800" />
<print output=" Android | 800x480 \n" />
<write filename="platforms/android/res/drawable-hdpi/ic_launcher.png" />
<resize width="720" height="1280" />
<print output=" Android | 71280x720 \n" />
<write filename="platforms/android/res/drawable-xhdpi/ic_launcher.png" />
<!-- iOS Splash -->
<resize width="320" height="480" />
<print output=" * iOS | 480x320 \n" />
<write filename="platforms/ios/%[project]/Resources/splash/Default~iphone.png" />
<resize width="640" height="960" />
<print output=" iOS | 960x640 \n" />
<write filename="platforms/ios/%[project]/Resources/splash/Default@2x~iphone.png" />
<resize width="640" height="1136" />
<print output=" iOS | 61136x640 \n" />
<write filename="platforms/ios/%[project]/Resources/splash/Default-568h@2x~iphone.png" />
</image>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment