From 81039f5bcf2da28c0e0d23d39271de796aa83f52 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 21 Feb 2025 07:36:28 -0500 Subject: [PATCH] update convert scripts and fixed card title size --- gallery/centerpiece/convertToWebp.sh | 8 ++-- gallery/centerpiece/updateGallery.sh | 1 + gallery/classic/convertToWebp.sh | 70 +++++++++++++++++++--------- gallery/classic/updateGallery.sh | 1 + gallery/organic/convertToWebp.sh | 70 +++++++++++++++++++--------- gallery/organic/updateGallery.sh | 2 + gallery/sculpture/convertToWebp.sh | 70 +++++++++++++++++++--------- gallery/sculpture/updateGallery.sh | 2 + 8 files changed, 154 insertions(+), 70 deletions(-) diff --git a/gallery/centerpiece/convertToWebp.sh b/gallery/centerpiece/convertToWebp.sh index d28c3a3..ba9748c 100755 --- a/gallery/centerpiece/convertToWebp.sh +++ b/gallery/centerpiece/convertToWebp.sh @@ -13,16 +13,16 @@ for ext in "${IMAGE_EXTENSIONS[@]}"; do # Determine the output file name based on the original extension case "$ext" in *.heic) - CONVERTED_FILE="${filename%.heic}.webp" + CONVERTED_FILE="${filename%.}.webp" ;; *.jpg|*.jpeg) - CONVERTED_FILE="${filename%.{jpg,jpeg}}.webp" + CONVERTED_FILE="${filename%.}.webp" ;; *.png) - CONVERTED_FILE="${filename%.png}.webp" + CONVERTED_FILE="${filename%.}.webp" ;; *.gif) - CONVERTED_FILE="${filename%.gif}.webp" + CONVERTED_FILE="${filename%.}.webp" ;; *) # Default case for unknown file types (if you add more later) echo "Unknown file type: $filename" diff --git a/gallery/centerpiece/updateGallery.sh b/gallery/centerpiece/updateGallery.sh index fbe80fc..52063d9 100755 --- a/gallery/centerpiece/updateGallery.sh +++ b/gallery/centerpiece/updateGallery.sh @@ -99,6 +99,7 @@ cat > "$OUTPUT_FILE" < "$txt_file" + echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}" - # Verify conversion success - if [[ -f "$CONVERTED_FILE" ]]; then - # Create a blank text file - txt_file="${CONVERTED_FILE%.webp}.txt" - echo -e "" > "$txt_file" - echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}" - else - echo "Error converting $filename" - fi -done + # Delete the original file + echo "Deleting original file: $filename" + rm "$filename" + + else + echo "Error converting $filename" + fi + done +done \ No newline at end of file diff --git a/gallery/classic/updateGallery.sh b/gallery/classic/updateGallery.sh index 53b9330..9c2c3b2 100755 --- a/gallery/classic/updateGallery.sh +++ b/gallery/classic/updateGallery.sh @@ -99,6 +99,7 @@ cat > "$OUTPUT_FILE" < "$txt_file" + echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}" - # Verify conversion success - if [[ -f "$CONVERTED_FILE" ]]; then - # Create a blank text file - txt_file="${CONVERTED_FILE%.webp}.txt" - echo -e "" > "$txt_file" - echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}" - else - echo "Error converting $filename" - fi -done + # Delete the original file + echo "Deleting original file: $filename" + rm "$filename" + + else + echo "Error converting $filename" + fi + done +done \ No newline at end of file diff --git a/gallery/organic/updateGallery.sh b/gallery/organic/updateGallery.sh index 27cf023..07ce0b2 100755 --- a/gallery/organic/updateGallery.sh +++ b/gallery/organic/updateGallery.sh @@ -99,6 +99,8 @@ cat > "$OUTPUT_FILE" < "$txt_file" + echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}" - # Verify conversion success - if [[ -f "$CONVERTED_FILE" ]]; then - # Create a blank text file - txt_file="${CONVERTED_FILE%.webp}.txt" - echo -e "" > "$txt_file" - echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}" - else - echo "Error converting $filename" - fi -done + # Delete the original file + echo "Deleting original file: $filename" + rm "$filename" + + else + echo "Error converting $filename" + fi + done +done \ No newline at end of file diff --git a/gallery/sculpture/updateGallery.sh b/gallery/sculpture/updateGallery.sh index 39bea25..3251c75 100755 --- a/gallery/sculpture/updateGallery.sh +++ b/gallery/sculpture/updateGallery.sh @@ -99,6 +99,8 @@ cat > "$OUTPUT_FILE" <