deployment prep

This commit is contained in:
Simon Martens
2025-09-30 12:21:57 +02:00
parent fb7231248c
commit 4218db49b5
10 changed files with 63 additions and 15 deletions

View File

@@ -13,9 +13,9 @@ BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Configuration
QUALITY=95 # WebP quality (0-100) - very high for single page viewer
COMPRESSION=1 # WebP compression level (0-6, lower = less compression, higher quality)
PICTURES_DIR="pictures"
QUALITY=88 # WebP quality (0-100) - high quality with good compression
COMPRESSION=2 # WebP compression level (0-6, lower = less compression, higher quality)
PICTURES_DIR="/app/data/pictures"
# Check if cwebp is installed
if ! command -v cwebp &> /dev/null; then
@@ -33,8 +33,8 @@ if [ ! -d "$PICTURES_DIR" ]; then
fi
echo -e "${BLUE}Generating high-quality WebP originals for single page viewer...${NC}"
echo "Quality: $QUALITY% (near-lossless)"
echo "Compression: $COMPRESSION (minimal compression for maximum quality)"
echo "Quality: $QUALITY% (high quality with compression)"
echo "Compression: $COMPRESSION (balanced compression for good quality)"
echo ""
# Counters

View File

@@ -13,7 +13,7 @@ NC='\033[0m' # No Color
# Configuration
QUALITY=75 # WebP quality (0-100)
COMPRESSION=6 # WebP compression level (0-6, higher = better compression)
PICTURES_DIR="pictures"
PICTURES_DIR="/app/data/pictures"
# Check if cwebp is installed
if ! command -v cwebp &> /dev/null; then
@@ -42,7 +42,7 @@ fi
echo -e "${GREEN}Generating WebP preview images...${NC}"
echo "Quality: $QUALITY%"
echo "Compression: $COMPRESSION"
echo "Resize: 50% (for faster loading)"
echo "Resize: 70% (for faster loading)"
echo ""
# Counters
@@ -70,13 +70,13 @@ process_file() {
echo -e "${YELLOW}Overriding existing preview: $webp_file${NC}"
fi
# Get image dimensions and calculate 50%
# Get image dimensions and calculate 70%
dimensions=$(identify -ping -format "%w %h" "$jpg_file" 2>/dev/null)
if [ $? -eq 0 ] && [ -n "$dimensions" ]; then
width=$(echo $dimensions | cut -d' ' -f1)
height=$(echo $dimensions | cut -d' ' -f2)
new_width=$((width / 2))
new_height=$((height / 2))
new_width=$((width * 70 / 100))
new_height=$((height * 70 / 100))
resize_params="-resize $new_width $new_height"
echo "Processing: $jpg_file -> $webp_file (${width}x${height}${new_width}x${new_height})"
else