-## Creating the .ico (Windows) and .icns (macOS) files from PNG images in linux
+## There is now a script utils/mk_jalview_icons.sh that creates the .icns and .ico icon files, and also the rotatable icon.
+Run it as
+```
+mk_jalview_icons.sh <BASENAME>-512.png
+```
+Having an existing 512x512 PNG image with the above filename format is important.
+It will then create multiple files
+`<BASENAME>-<N>.png`
+for N being 16, 32, 38, 48, 64, 128, 256.
+**NB** You might want to edit these as described below. The `mk_jalview_icons.sh` will not overwrite these files, but it
+will overwrite the `.ico` and `.icns` files, so after editing the `<BASENAME>-<N>.png` files, just run the script again.
+
+As below, the script relies on ImageMagick and icnsutils being installed with `convert` and `png2icns` in the PATH.
+
+The rotatable logo will also be created (and overwritten) as
+`rotatable_<BASENAME>-38.png`
+
+
+## Old text
+### Creating the .ico (Windows) and .icns (macOS) files from PNG images in linux
Create multiple square versions of your icon at the following resolutions:
16x16, 32x32, 48x48, 64x64, 128x128, 256x256, 512x512
This icon is used by the web services progress window, with the rotating Jalview logo.
It requires some small margin of white pixels around the logo to enable antialiasing around the edge of the logo.
-You can make one form a 48x48 transparent logo with
+You can make one form a 38x38 transparent logo with
```
convert jalview_logo-38.png -gravity center -background white -extent 60x60 rotatable_jalview_logo-38.png
```
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
- width="595.238px" height="595.238px" viewBox="0 0 595.238 595.238" enable-background="new 0 0 595.238 595.238"
- xml:space="preserve">
-<rect x="234.925" y="234.464" fill="#0084A9" width="127.944" height="127.942"/>
-<polygon fill="#AD208E" points="395.955,38.359 38.788,38.359 38.823,362.389 103.187,362.389 103.187,102.72 460.325,102.72 "/>
-<polygon fill="#F78E1E" points="202.144,362.313 202.144,201.678 559.28,201.678 497.633,140.041 140.481,140.041 140.481,362.313
- "/>
-<polygon fill="#009DDC" points="202.225,558.595 560.882,558.607 560.848,234.574 496.501,234.574 496.501,494.26 137.861,494.236
- "/>
-<polygon fill="#C1D82F" points="395.688,234.646 395.688,395.282 38.904,395.282 100.535,456.929 457.329,456.929 457.329,234.646
- "/>
-<polygon fill="#008FC9" points="205.667,554.03 554.448,554.03 554.412,240.517 544.805,240.615 544.805,545.863 197.488,545.863
- "/>
-<polyline fill="#B0C62B" points="103.158,450.545 452.339,450.545 452.339,240.505 445.537,240.505 445.537,443.737 96.374,443.737
- "/>
-<polygon fill="#007799" points="356.649,240.339 241.236,240.339 241.236,356.261 247.337,356.261 247.337,246.708 356.649,246.708
- "/>
-<polygon fill="#0095B7" points="251.131,356.191 356.649,356.191 356.649,250.696 350.543,250.696 350.543,350.185 251.131,350.185
- "/>
-<polygon fill="#B956A0" points="97.55,356.417 97.55,96.444 446.327,96.444 436.58,86.163 87.278,86.163 87.278,356.347 "/>
-<polygon fill="#35ABE1" points="502.531,240.517 502.414,499.929 151.207,499.929 160.779,509.2 512.916,509.2 512.823,240.485 "/>
-<polygon fill="#CDDE5C" points="402.263,240.345 402.263,401.857 53.901,401.857 59.797,407.742 408.142,407.742 408.142,240.345
- "/>
-<polygon fill="#911076" points="53.112,356.377 53.112,52.218 404.342,52.102 395.792,43.38 43.473,43.363 43.504,356.377 "/>
-<polygon fill="#F9A24A" points="197.059,356.365 197.059,196.854 546.188,196.854 540.054,190.97 191.181,190.97 191.181,356.365
- "/>
-<polygon fill="#E4841C" points="155.107,356.365 155.2,153.2 502.403,153.2 495.595,146.38 147.283,146.38 147.283,356.365 "/>
-<path fill="none" stroke="#000000" stroke-width="0.1" d="M41.451,391.681"/>
-<path fill="none" stroke="#000000" stroke-width="0.1" d="M211.905,562.132"/>
-</svg>
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="522.09399"
+ height="522.09399"
+ viewBox="0 0 522.09402 522.09402"
+ enable-background="new 0 0 595.238 595.238"
+ xml:space="preserve"
+ sodipodi:docname="jalview_test-release_logo.svg"
+ inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"><metadata
+ id="metadata41"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs39" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="2569"
+ inkscape:window-height="1721"
+ id="namedview37"
+ showgrid="false"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:zoom="2.24283"
+ inkscape:cx="258.83099"
+ inkscape:cy="260.988"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" />
+<rect
+ x="196.13701"
+ y="197.95102"
+ width="127.944"
+ height="127.942"
+ id="rect2"
+ style="fill:#0084a9" />
+<polygon
+ points="38.823,362.389 103.187,362.389 103.187,102.72 460.325,102.72 395.955,38.359 38.788,38.359 "
+ id="polygon4"
+ style="fill:#ad208e"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="559.28,201.678 497.633,140.041 140.481,140.041 140.481,362.313 202.144,362.313 202.144,201.678 "
+ id="polygon6"
+ style="fill:#f78e1e"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="560.848,234.574 496.501,234.574 496.501,494.26 137.861,494.236 202.225,558.595 560.882,558.607 "
+ id="polygon8"
+ style="fill:#009ddc"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="38.904,395.282 100.535,456.929 457.329,456.929 457.329,234.646 395.688,234.646 395.688,395.282 "
+ id="polygon10"
+ style="fill:#c1d82f"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="554.412,240.517 544.805,240.615 544.805,545.863 197.488,545.863 205.667,554.03 554.448,554.03 "
+ id="polygon12"
+ style="fill:#008fc9"
+ transform="translate(-38.788,-36.512996)" />
+<polyline
+ points="103.158,450.545 452.339,450.545 452.339,240.505 445.537,240.505 445.537,443.737 96.374,443.737 "
+ id="polyline14"
+ style="fill:#b0c62b"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="241.236,356.261 247.337,356.261 247.337,246.708 356.649,246.708 356.649,240.339 241.236,240.339 "
+ id="polygon16"
+ style="fill:#007799"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="356.649,250.696 350.543,250.696 350.543,350.185 251.131,350.185 251.131,356.191 356.649,356.191 "
+ id="polygon18"
+ style="fill:#0095b7"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="446.327,96.444 436.58,86.163 87.278,86.163 87.278,356.347 97.55,356.417 97.55,96.444 "
+ id="polygon20"
+ style="fill:#b956a0"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="151.207,499.929 160.779,509.2 512.916,509.2 512.823,240.485 502.531,240.517 502.414,499.929 "
+ id="polygon22"
+ style="fill:#35abe1"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="53.901,401.857 59.797,407.742 408.142,407.742 408.142,240.345 402.263,240.345 402.263,401.857 "
+ id="polygon24"
+ style="fill:#cdde5c"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="404.342,52.102 395.792,43.38 43.473,43.363 43.504,356.377 53.112,356.377 53.112,52.218 "
+ id="polygon26"
+ style="fill:#911076"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="546.188,196.854 540.054,190.97 191.181,190.97 191.181,356.365 197.059,356.365 197.059,196.854 "
+ id="polygon28"
+ style="fill:#f9a24a"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="502.403,153.2 495.595,146.38 147.283,146.38 147.283,356.365 155.107,356.365 155.2,153.2 "
+ id="polygon30"
+ style="fill:#e4841c"
+ transform="translate(-38.788,-36.512996)" />
+<path
+ d="M 2.663,355.168"
+ id="path32"
+ inkscape:connector-curvature="0"
+ style="fill:none;stroke:#000000;stroke-width:0.1" />
+
+</svg>
\ No newline at end of file
getdown_instant_background_image = jalview_test-release_getdown_background_initialising.png
getdown_error_background = jalview_test-release_getdown_background_error.png
getdown_progress_image = jalview_getdown_progress_bar.png
-getdown_mac_dock_icon = jalview_logo.icns
-getdown_icon = jalview_logo.png
+getdown_mac_dock_icon = jalview_test-release_logo.icns
+getdown_icon = jalview_test-release_logo.png
getdown_txt_allow_offline = true
getdown_txt_max_concurrent_downloads = 10
getdown_txt_ui.install_error = https://www.jalview.org/faq/getdownerror
getdown_txt_ui.hide_decorations = true
install4j_images_dir = utils/channels/test-release/images
-install4j_mac_icons_file = jalview_logo.icns
-install4j_windows_icons_file = jalview_logo.ico
-install4j_png_icon_file = jalview_logo.png
+install4j_mac_icons_file = jalview_test-release_logo.icns
+install4j_windows_icons_file = jalview_test-release_logo.ico
+install4j_png_icon_file = jalview_test-release_logo.png
install4j_background = jalview_logo_background_fade-640x480.png
install4j_dmg_background = jalview_test-release_dmg_background-72dpi.png
install4j_dmg_ds_store = jalview_test-release_dmg_DS_Store
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
- width="595.238px" height="595.238px" viewBox="0 0 595.238 595.238" enable-background="new 0 0 595.238 595.238"
- xml:space="preserve">
-<rect x="234.925" y="234.464" fill="#0084A9" width="127.944" height="127.942"/>
-<polygon fill="#AD208E" points="395.955,38.359 38.788,38.359 38.823,362.389 103.187,362.389 103.187,102.72 460.325,102.72 "/>
-<polygon fill="#F78E1E" points="202.144,362.313 202.144,201.678 559.28,201.678 497.633,140.041 140.481,140.041 140.481,362.313
- "/>
-<polygon fill="#009DDC" points="202.225,558.595 560.882,558.607 560.848,234.574 496.501,234.574 496.501,494.26 137.861,494.236
- "/>
-<polygon fill="#C1D82F" points="395.688,234.646 395.688,395.282 38.904,395.282 100.535,456.929 457.329,456.929 457.329,234.646
- "/>
-<polygon fill="#008FC9" points="205.667,554.03 554.448,554.03 554.412,240.517 544.805,240.615 544.805,545.863 197.488,545.863
- "/>
-<polyline fill="#B0C62B" points="103.158,450.545 452.339,450.545 452.339,240.505 445.537,240.505 445.537,443.737 96.374,443.737
- "/>
-<polygon fill="#007799" points="356.649,240.339 241.236,240.339 241.236,356.261 247.337,356.261 247.337,246.708 356.649,246.708
- "/>
-<polygon fill="#0095B7" points="251.131,356.191 356.649,356.191 356.649,250.696 350.543,250.696 350.543,350.185 251.131,350.185
- "/>
-<polygon fill="#B956A0" points="97.55,356.417 97.55,96.444 446.327,96.444 436.58,86.163 87.278,86.163 87.278,356.347 "/>
-<polygon fill="#35ABE1" points="502.531,240.517 502.414,499.929 151.207,499.929 160.779,509.2 512.916,509.2 512.823,240.485 "/>
-<polygon fill="#CDDE5C" points="402.263,240.345 402.263,401.857 53.901,401.857 59.797,407.742 408.142,407.742 408.142,240.345
- "/>
-<polygon fill="#911076" points="53.112,356.377 53.112,52.218 404.342,52.102 395.792,43.38 43.473,43.363 43.504,356.377 "/>
-<polygon fill="#F9A24A" points="197.059,356.365 197.059,196.854 546.188,196.854 540.054,190.97 191.181,190.97 191.181,356.365
- "/>
-<polygon fill="#E4841C" points="155.107,356.365 155.2,153.2 502.403,153.2 495.595,146.38 147.283,146.38 147.283,356.365 "/>
-<path fill="none" stroke="#000000" stroke-width="0.1" d="M41.451,391.681"/>
-<path fill="none" stroke="#000000" stroke-width="0.1" d="M211.905,562.132"/>
-</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="522.09399"
+ height="522.09399"
+ viewBox="0 0 522.09402 522.09402"
+ enable-background="new 0 0 595.238 595.238"
+ xml:space="preserve"
+ sodipodi:docname="jalview_test-release_logo.svg"
+ inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
+ inkscape:export-filename="/home/bsoares/Work/git/develop/jalview/utils/channels/tmp/jalview_test-release_logo-512.png"
+ inkscape:export-xdpi="94.139999"
+ inkscape:export-ydpi="94.139999"><metadata
+ id="metadata41"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs39" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="2569"
+ inkscape:window-height="1721"
+ id="namedview37"
+ showgrid="false"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:zoom="0.56070751"
+ inkscape:cx="258.83099"
+ inkscape:cy="260.988"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" />
+<rect
+ x="196.13701"
+ y="197.95102"
+ width="127.944"
+ height="127.942"
+ id="rect2"
+ style="fill:#ffffff;fill-opacity:1" />
+<polygon
+ points="38.823,362.389 103.187,362.389 103.187,102.72 460.325,102.72 395.955,38.359 38.788,38.359 "
+ id="polygon4"
+ style="fill:#ad208e"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="559.28,201.678 497.633,140.041 140.481,140.041 140.481,362.313 202.144,362.313 202.144,201.678 "
+ id="polygon6"
+ style="fill:#f78e1e"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="560.848,234.574 496.501,234.574 496.501,494.26 137.861,494.236 202.225,558.595 560.882,558.607 "
+ id="polygon8"
+ style="fill:#009ddc"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="38.904,395.282 100.535,456.929 457.329,456.929 457.329,234.646 395.688,234.646 395.688,395.282 "
+ id="polygon10"
+ style="fill:#c1d82f"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="554.412,240.517 544.805,240.615 544.805,545.863 197.488,545.863 205.667,554.03 554.448,554.03 "
+ id="polygon12"
+ style="fill:#008fc9"
+ transform="translate(-38.788,-36.512996)" />
+<polyline
+ points="103.158,450.545 452.339,450.545 452.339,240.505 445.537,240.505 445.537,443.737 96.374,443.737 "
+ id="polyline14"
+ style="fill:#b0c62b"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="241.236,356.261 247.337,356.261 247.337,246.708 356.649,246.708 356.649,240.339 241.236,240.339 "
+ id="polygon16"
+ style="fill:#d4d4d4;fill-opacity:1"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="356.649,250.696 350.543,250.696 350.543,350.185 251.131,350.185 251.131,356.191 356.649,356.191 "
+ id="polygon18"
+ style="fill:#f1f1f1;fill-opacity:1"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="446.327,96.444 436.58,86.163 87.278,86.163 87.278,356.347 97.55,356.417 97.55,96.444 "
+ id="polygon20"
+ style="fill:#b956a0"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="151.207,499.929 160.779,509.2 512.916,509.2 512.823,240.485 502.531,240.517 502.414,499.929 "
+ id="polygon22"
+ style="fill:#35abe1"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="53.901,401.857 59.797,407.742 408.142,407.742 408.142,240.345 402.263,240.345 402.263,401.857 "
+ id="polygon24"
+ style="fill:#cdde5c"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="404.342,52.102 395.792,43.38 43.473,43.363 43.504,356.377 53.112,356.377 53.112,52.218 "
+ id="polygon26"
+ style="fill:#911076"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="546.188,196.854 540.054,190.97 191.181,190.97 191.181,356.365 197.059,356.365 197.059,196.854 "
+ id="polygon28"
+ style="fill:#f9a24a"
+ transform="translate(-38.788,-36.512996)" />
+<polygon
+ points="502.403,153.2 495.595,146.38 147.283,146.38 147.283,356.365 155.107,356.365 155.2,153.2 "
+ id="polygon30"
+ style="fill:#e4841c"
+ transform="translate(-38.788,-36.512996)" />
+<path
+ d="M 2.663,355.168"
+ id="path32"
+ inkscape:connector-curvature="0"
+ style="fill:none;stroke:#000000;stroke-width:0.1" />
+
+</svg>
\ No newline at end of file
app_name=Jalview Test
banner=/images/jalview_test-release_banner.png
-logo.16=/images/jalview_logo-16.png
-logo.32=/images/jalview_logo-32.png
-logo.38=/images/jalview_logo-38.png
-logo.48=/images/jalview_logo-48.png
-logo.64=/images/jalview_logo-64.png
-logo.128=/images/jalview_logo-128.png
-logo.256=/images/jalview_logo-256.png
-logo.512=/images/jalview_logo-512.png
-rotatable_logo.48=/images/rotatable_jalview_logo-38.png
+logo.16=/images/jalview_test-release_logo-16.png
+logo.32=/images/jalview_test-release_logo-32.png
+logo.38=/images/jalview_test-release_logo-38.png
+logo.48=/images/jalview_test-release_logo-48.png
+logo.64=/images/jalview_test-release_logo-64.png
+logo.128=/images/jalview_test-release_logo-128.png
+logo.256=/images/jalview_test-release_logo-256.png
+logo.512=/images/jalview_test-release_logo-512.png
+rotatable_logo.48=/images/rotatable_jalview_test-release_logo-38.png
bg_logo.28=/images/barton_group-28.png
bg_logo.30=/images/barton_group-30.png
bg_logo.32=/images/barton_group-32.png
uod_banner.28=/images/UoD_banner-28.png
uod_banner.30=/images/UoD_banner-30.png
uod_banner.32=/images/UoD_banner-32.png
-default_appbase=https://www.jalview.org/getdown/release/1.8
-preferences.filename=.jalview_properties
+default_appbase=https://www.jalview.org/getdown/test-release/1.8
+preferences.filename=.jalview_test_properties
+++ /dev/null
-#!/usr/bin/env bash
-
-# given a list of differently sized png files with the size in the filename like this:
-# myiconfile-16.png myiconfile-32.png myiconfile-48.png myiconfile-64.png myiconfile-128.png myiconfile-256.png myiconfile-512.png
-# run
-# create_iconfiles.sh myiconfile-*.png
-# to create an ICO file (for Windows) myiconfile.ico and an ICNS file (for macOS) myiconfile.icns
-
-BASENAME=${1%-*}
-if [ x$BASENAME = x ]; then
- echo "Could not calculate basename from '${1}'"
- exit 1
-fi
-
-ICOFILE=${BASENAME}.ico
-echo "Creating ${ICOFILE}"
-convert $* ${ICOFILE}
-
-ICNSFILE=${BASENAME}.icns
-echo "Creating ${ICNSFILE}"
-# dont' include 64x64 icon (for some reason they're not allowed in icns file)
-ICNSARGS=""
-for ARG in $*; do
- NUM=${ARG##*-}
- NUM=${NUM%px*}
- NUM=${NUM%x*}
- NUM=${NUM%.*}
- if [ x$NUM != x64 -a x$NUM != x38 ]; then
- ICNSARGS="${ICNSARGS} $ARG"
- fi
-done
-png2icns ${ICNSFILE} ${ICNSARGS}
--- /dev/null
+#!/usr/bin/env bash
+
+FILENAME512=$1
+BASENAME=${FILENAME512%-512.png}
+
+usage () {
+ echo "$(basename "$0") <LOGO_NAME>-512.png"
+}
+
+[ "$1" = "-h" ] && usage && exit 0
+[ -r "$FILENAME512" ] || ( usage && echo "'${FILENAME512}' must exist and be readable" && exit 1 )
+[ "$BASENAME" = "$FILENAME512" ] && usage && echo "Must have '-512.png' at end of filename" && exit 2
+
+set -e
+
+SIZES="16 32 38 48 64 128 256"
+declare -a ICOFILES=()
+declare -a ICNSFILES=()
+for n in $SIZES
+do
+ NEWFILE="${BASENAME}-${n}.png"
+ [ -e "{$NEWFILE}" ] && continue
+ convert -geometry "${n}x${n}" "${BASENAME}-512.png" "${NEWFILE}"
+ [ "${n}" != 38 ] && ICOFILES=( "${ICOFILES[@]}" "${NEWFILE}" )
+ [ "${n}" != 64 ] && [ "${n}" != 38 ] && ICNSFILES=( "${ICNSFILES[@]}" "${NEWFILE}" )
+done
+
+# make the .ico
+ICOFILE="${BASENAME}.ico"
+echo "Creating ${ICOFILE}"
+convert "${ICOFILES[@]}" "${ICOFILE}"
+
+# make the .icns
+ICNSFILE="${BASENAME}.icns"
+echo "Creating ${ICNSFILE}"
+png2icns "${ICNSFILE}" "${ICNSFILES[@]}"
+
+# make the rotatable icon
+ROTATABLEFILE="rotatable_${BASENAME}-38.png"
+convert "${BASENAME}-38.png" -gravity center -background white -extent 60x60 "${ROTATABLEFILE}"
+
+exit 0