mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-10-06 04:20:30 +00:00
When ICON is GIF, extract only first frame (#1420)
This commit is contained in:
+10
-4
@@ -5,13 +5,19 @@
|
|||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
if [ -n "$ICON" ]; then
|
if [ -n "$ICON" ]; then
|
||||||
if [ ! -e server-icon.png ] || [ "${OVERRIDE_ICON}" == "TRUE" ]; then
|
if [ ! -e server-icon.png ] || isTrue "${OVERRIDE_ICON}"; then
|
||||||
log "Using server icon from $ICON..."
|
log "Using server icon from $ICON..."
|
||||||
# Not sure what it is yet...call it "img"
|
# Not sure what it is yet...call it "img"
|
||||||
curl -sSL -o /tmp/icon.img $ICON
|
if ! get -o /tmp/icon.img "$ICON"; then
|
||||||
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
|
log "ERROR: failed to download icon from $ICON"
|
||||||
if [ "$specs" = "PNG 64x64" ]; then
|
exit 1
|
||||||
|
fi
|
||||||
|
read -r -a specs < <(identify /tmp/icon.img | awk 'NR == 1 { print $2, $3 }')
|
||||||
|
if [ "${specs[0]} ${specs[1]}" = "PNG 64x64" ]; then
|
||||||
mv /tmp/icon.img /data/server-icon.png
|
mv /tmp/icon.img /data/server-icon.png
|
||||||
|
elif [ "${specs[0]}" = GIF ]; then
|
||||||
|
log "Converting GIF image to 64x64 PNG..."
|
||||||
|
convert "/tmp/icon.img[0]" -resize 64x64! /data/server-icon.png
|
||||||
else
|
else
|
||||||
log "Converting image to 64x64 PNG..."
|
log "Converting image to 64x64 PNG..."
|
||||||
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
|
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
image: nginx
|
||||||
|
volumes:
|
||||||
|
- ./web:/usr/share/nginx/html
|
||||||
|
mc:
|
||||||
|
depends_on:
|
||||||
|
- web
|
||||||
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
|
environment:
|
||||||
|
EULA: "true"
|
||||||
|
SETUP_ONLY: "true"
|
||||||
|
ICON: http://web/motion-tween-example.gif
|
||||||
|
# the following are only used to speed up test execution
|
||||||
|
TYPE: CUSTOM
|
||||||
|
CUSTOM_SERVER: /servers/fake.jar
|
||||||
|
VERSION: 1.18.1
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
- ./fake.jar:/servers/fake.jar
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
mc-image-helper assert fileExists server-icon.png
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
@@ -0,0 +1,22 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
image: nginx
|
||||||
|
volumes:
|
||||||
|
- ./web:/usr/share/nginx/html
|
||||||
|
mc:
|
||||||
|
depends_on:
|
||||||
|
- web
|
||||||
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
|
environment:
|
||||||
|
EULA: "true"
|
||||||
|
SETUP_ONLY: "true"
|
||||||
|
ICON: http://web/4737386_minecraft_squircle_icon.png
|
||||||
|
# the following are only used to speed up test execution
|
||||||
|
TYPE: CUSTOM
|
||||||
|
CUSTOM_SERVER: /servers/fake.jar
|
||||||
|
VERSION: 1.18.1
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
- ./fake.jar:/servers/fake.jar
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
mc-image-helper assert fileExists server-icon.png
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 592 B |
@@ -0,0 +1,22 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
image: nginx
|
||||||
|
volumes:
|
||||||
|
- ./web:/usr/share/nginx/html
|
||||||
|
mc:
|
||||||
|
depends_on:
|
||||||
|
- web
|
||||||
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
|
environment:
|
||||||
|
EULA: "true"
|
||||||
|
SETUP_ONLY: "true"
|
||||||
|
ICON: http://web/4737386_minecraft_squircle_icon.png
|
||||||
|
# the following are only used to speed up test execution
|
||||||
|
TYPE: CUSTOM
|
||||||
|
CUSTOM_SERVER: /servers/fake.jar
|
||||||
|
VERSION: 1.18.1
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
- ./fake.jar:/servers/fake.jar
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
mc-image-helper assert fileExists server-icon.png
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user