Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add_new_spectron_test' into dev, fixes #983
- Loading branch information
Showing
22 changed files
with
2,303 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/bin/sh | ||
|
||
|
||
# Exec Paths | ||
SIPS='/usr/bin/sips' | ||
ICONUTIL='/usr/bin/iconutil' | ||
if [ ! -x "${SIPS}" ]; then | ||
echo "Cannot find required SIPS executable at: ${SIPS}" >&2 | ||
exit 1; | ||
fi | ||
if [ ! -x "${ICONUTIL}" ]; then | ||
echo "Cannot find required ICONUTIL executable at: ${ICONUTIL}" >&2 | ||
exit 1; | ||
fi | ||
|
||
# Parameters | ||
SOURCE=$1 | ||
|
||
# Get source image | ||
if [ -z "${SOURCE}" ]; then | ||
echo "No source image specified, searching in current directory...\c" | ||
SOURCE=$( ls *.png | head -n1 ) | ||
if [ -z "${SOURCE}" ]; then | ||
echo "No source image specified and none found." | ||
exit 1; | ||
else | ||
echo "FOUND"; | ||
fi | ||
fi | ||
|
||
|
||
# File Infrastructure | ||
NAME=$(basename "${SOURCE}") | ||
EXT="${NAME##*.}" | ||
BASE="${NAME%.*}" | ||
ICONSET="${BASE}.iconset" | ||
|
||
# Debug Info | ||
echo "SOURCE: ${SOURCE}" | ||
echo "NAME: $NAME" | ||
echo "BASE: $BASE" | ||
echo "EXT: $EXT" | ||
echo "ICONSET: $ICONSET" | ||
|
||
# Get source image info | ||
SRCWIDTH=$( $SIPS -g pixelWidth "${SOURCE}" | tail -n1 | awk '{print $2}') | ||
SRCHEIGHT=$( $SIPS -g pixelHeight "${SOURCE}" | tail -n1 | awk '{print $2}' ) | ||
SRCFORMAT=$( $SIPS -g format "${SOURCE}" | tail -n1 | awk '{print $2}' ) | ||
|
||
# Debug Info | ||
echo "SRCWIDTH: $SRCWIDTH" | ||
echo "SRCHEIGHT: $SRCHEIGHT" | ||
echo "SRCFORMAT: $SRCFORMAT" | ||
|
||
# Check The Source Image | ||
if [ "x${SRCWIDTH}" != "x1024" ] || [ "x${SRCHEIGHT}" != "x1024" ]; then | ||
echo "ERR: Source image should be 1024 x 1024 pixels." >&2 | ||
exit 1; | ||
fi | ||
if [ "x${SRCFORMAT}" != "xpng" ]; then | ||
echo "ERR: Source image format should be png." >&2 | ||
exit 1; | ||
fi | ||
|
||
# Resample image into iconset | ||
mkdir "${ICONSET}" | ||
$SIPS -s format png --resampleWidth 1024 "${SOURCE}" --out "${ICONSET}/icon_512x512@2x.png" > /dev/null 2>&1 | ||
$SIPS -s format png --resampleWidth 512 "${SOURCE}" --out "${ICONSET}/icon_512x512.png" > /dev/null 2>&1 | ||
cp "${ICONSET}/icon_512x512.png" "${ICONSET}/icon_256x256@2x.png" | ||
$SIPS -s format png --resampleWidth 256 "${SOURCE}" --out "${ICONSET}/icon_256x256.png" > /dev/null 2>&1 | ||
cp "${ICONSET}/icon_256x256.png" "${ICONSET}/icon_128x128@2x.png" | ||
$SIPS -s format png --resampleWidth 128 "${SOURCE}" --out "${ICONSET}/icon_128x128.png" > /dev/null 2>&1 | ||
$SIPS -s format png --resampleWidth 64 "${SOURCE}" --out "${ICONSET}/icon_32x32@2x.png" > /dev/null 2>&1 | ||
$SIPS -s format png --resampleWidth 32 "${SOURCE}" --out "${ICONSET}/icon_32x32.png" > /dev/null 2>&1 | ||
cp "${ICONSET}/icon_32x32.png" "${ICONSET}/icon_16x16@2x.png" | ||
$SIPS -s format png --resampleWidth 16 "${SOURCE}" --out "${ICONSET}/icon_16x16.png" > /dev/null 2>&1 | ||
|
||
# Create an icns file from the iconset | ||
$ICONUTIL -c icns "${ICONSET}" | ||
|
||
# Clean up the iconset | ||
rm -rf "${ICONSET}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.