Skip to content

Commit

Permalink
Make generate-images.sh create main-mobile.png
Browse files Browse the repository at this point in the history
* Change the `generate-images.sh` script so that it automatically
  generates the `main-mobile.png` image when any of the logos included
  in it are changed.

* Regenerate the `main-mobile.png` image.

Ref alrra#54
    alrra#56
  • Loading branch information
alrra committed Dec 16, 2014
1 parent 5b4bdc0 commit 42c67bf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
### HEAD

* Add Opera Mini logo.
* Add `main-mobile.png`
[[#54](https://github.com/alrra/browser-logos/issues/54)]
[[#56](https://github.com/alrra/browser-logos/issues/56)].
* Add Opera Mini logo
[[8dda27f](https://github.com/alrra/browser-logos/commit/8dda27fbf2dce1c2870ea4115fa198c2bf64233a)].
* Add Android browser logo
[[#55](https://github.com/alrra/browser-logos/issues/55)].

Expand Down
21 changes: 15 additions & 6 deletions bin/generate-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

declare groupImageName="main-desktop"

declare -a imageGroup=(
declare -a mainDesktopImageGroup=(
"chrome"
"firefox"
"internet-explorer"
"opera"
"safari"
)

declare -a mainMobileImageGroup=(
"android"
"chrome-android"
"internet-explorer-tile"
"opera-mini"
"safari-ios"
)

declare -a imageSizes=(
'16x16'
'24x24'
Expand All @@ -38,6 +44,8 @@ declare scriptLocation="$(dirname ${BASH_SOURCE[0]})"
generate_group_image() {

local generateGroupImage="false"
declare -a imageGroup=("${!1}"); shift;
local groupImageName="$1.png"; shift;
declare -a tmp=()

# Do not generate new group image if none of composing images are modified
Expand Down Expand Up @@ -70,8 +78,8 @@ generate_group_image() {
-resize 512x512 \
-extent 562x562 \
+append \
"$groupImageName.png" \
&& print_success_msg " [create]" "$groupImageName.png"
"$groupImageName" \
&& print_success_msg " [create]" "$groupImageName"

fi
}
Expand Down Expand Up @@ -144,7 +152,8 @@ main() {
print_success_msg "Generate images"
printf "\n"

generate_group_image $@ \
generate_group_image mainDesktopImageGroup[@] "main-desktop" $@ \
&& generate_group_image mainMobileImageGroup[@] "main-mobile" $@ \
&& generate_images $@ \
&& (
printf "\n"
Expand Down
Binary file modified main-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 42c67bf

Please sign in to comment.