update convert scripts and fixed card title size

This commit is contained in:
chris 2025-02-21 07:36:28 -05:00
parent f6141b0047
commit 81039f5bcf
8 changed files with 154 additions and 70 deletions

View File

@ -13,16 +13,16 @@ for ext in "${IMAGE_EXTENSIONS[@]}"; do
# Determine the output file name based on the original extension # Determine the output file name based on the original extension
case "$ext" in case "$ext" in
*.heic) *.heic)
CONVERTED_FILE="${filename%.heic}.webp" CONVERTED_FILE="${filename%.}.webp"
;; ;;
*.jpg|*.jpeg) *.jpg|*.jpeg)
CONVERTED_FILE="${filename%.{jpg,jpeg}}.webp" CONVERTED_FILE="${filename%.}.webp"
;; ;;
*.png) *.png)
CONVERTED_FILE="${filename%.png}.webp" CONVERTED_FILE="${filename%.}.webp"
;; ;;
*.gif) *.gif)
CONVERTED_FILE="${filename%.gif}.webp" CONVERTED_FILE="${filename%.}.webp"
;; ;;
*) # Default case for unknown file types (if you add more later) *) # Default case for unknown file types (if you add more later)
echo "Unknown file type: $filename" echo "Unknown file type: $filename"

View File

@ -99,6 +99,7 @@ cat > "$OUTPUT_FILE" <<EOL
.modal-card-title { .modal-card-title {
font-family: 'Autour One', cursive; font-family: 'Autour One', cursive;
background-color: transparent !important; background-color: transparent !important;
font-size: 1rem;
} }
.modal-card-body{ .modal-card-body{
display: flex; display: flex;

View File

@ -3,30 +3,56 @@
# Specify the input directory # Specify the input directory
INPUT_DIR="../../assets/pics/gallery/classic" INPUT_DIR="../../assets/pics/gallery/classic"
# Ensure ImageMagick is installed # Array of image extensions to process (excluding webp)
IMAGE_EXTENSIONS=("*.heic" "*.jpg" "*.jpeg" "*.png" "*.gif")
# Loop through each image extension
for ext in "${IMAGE_EXTENSIONS[@]}"; do
# Find files matching the current extension
for filename in $(find "$INPUT_DIR" -type f -name "$ext"); do
# Determine the output file name based on the original extension
case "$ext" in
*.heic)
CONVERTED_FILE="${filename%.}.webp"
;;
*.jpg|*.jpeg)
CONVERTED_FILE="${filename%.}.webp"
;;
*.png)
CONVERTED_FILE="${filename%.}.webp"
;;
*.gif)
CONVERTED_FILE="${filename%.}.webp"
;;
*) # Default case for unknown file types (if you add more later)
echo "Unknown file type: $filename"
continue # Skip to the next file
;;
esac
for filename in $(find "$INPUT_DIR" -type f -name "*.heic"); do # Skip if already converted
# Define the output file name if [[ -f "$CONVERTED_FILE" ]]; then
CONVERTED_FILE="${filename%.heic}.webp" echo "Skipping $filename, already converted."
continue
fi
# Skip if already converted # Convert to WEBP
if [[ -f "$CONVERTED_FILE" ]]; then echo "Converting $filename to $CONVERTED_FILE..."
echo "Skipping $filename, already converted." convert "$filename" -quality 85 "$CONVERTED_FILE"
continue
fi
# Convert HEIC to WEBP # Verify conversion success
echo "Converting $filename to $CONVERTED_FILE..." if [[ -f "$CONVERTED_FILE" ]]; then
convert "$filename" -quality 85 "$CONVERTED_FILE" # Create a blank text file (caption file)
txt_file="${CONVERTED_FILE%.webp}.txt"
echo -e "" > "$txt_file"
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}"
# Verify conversion success # Delete the original file
if [[ -f "$CONVERTED_FILE" ]]; then echo "Deleting original file: $filename"
# Create a blank text file rm "$filename"
txt_file="${CONVERTED_FILE%.webp}.txt"
echo -e "" > "$txt_file" else
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}" echo "Error converting $filename"
else fi
echo "Error converting $filename" done
fi
done done

View File

@ -99,6 +99,7 @@ cat > "$OUTPUT_FILE" <<EOL
.modal-card-title { .modal-card-title {
font-family: 'Autour One', cursive; font-family: 'Autour One', cursive;
background-color: transparent !important; background-color: transparent !important;
font-size: 1rem;
} }
.modal-card-body{ .modal-card-body{
display: flex; display: flex;

View File

@ -3,30 +3,56 @@
# Specify the input directory # Specify the input directory
INPUT_DIR="../../assets/pics/gallery/organic" INPUT_DIR="../../assets/pics/gallery/organic"
# Ensure ImageMagick is installed # Array of image extensions to process (excluding webp)
IMAGE_EXTENSIONS=("*.heic" "*.jpg" "*.jpeg" "*.png" "*.gif")
# Loop through each image extension
for ext in "${IMAGE_EXTENSIONS[@]}"; do
# Find files matching the current extension
for filename in $(find "$INPUT_DIR" -type f -name "$ext"); do
# Determine the output file name based on the original extension
case "$ext" in
*.heic)
CONVERTED_FILE="${filename%.}.webp"
;;
*.jpg|*.jpeg)
CONVERTED_FILE="${filename%.}.webp"
;;
*.png)
CONVERTED_FILE="${filename%.}.webp"
;;
*.gif)
CONVERTED_FILE="${filename%.}.webp"
;;
*) # Default case for unknown file types (if you add more later)
echo "Unknown file type: $filename"
continue # Skip to the next file
;;
esac
for filename in $(find "$INPUT_DIR" -type f -name "*.heic"); do # Skip if already converted
# Define the output file name if [[ -f "$CONVERTED_FILE" ]]; then
CONVERTED_FILE="${filename%.heic}.webp" echo "Skipping $filename, already converted."
continue
fi
# Skip if already converted # Convert to WEBP
if [[ -f "$CONVERTED_FILE" ]]; then echo "Converting $filename to $CONVERTED_FILE..."
echo "Skipping $filename, already converted." convert "$filename" -quality 85 "$CONVERTED_FILE"
continue
fi
# Convert HEIC to WEBP # Verify conversion success
echo "Converting $filename to $CONVERTED_FILE..." if [[ -f "$CONVERTED_FILE" ]]; then
convert "$filename" -quality 85 "$CONVERTED_FILE" # Create a blank text file (caption file)
txt_file="${CONVERTED_FILE%.webp}.txt"
echo -e "" > "$txt_file"
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}"
# Verify conversion success # Delete the original file
if [[ -f "$CONVERTED_FILE" ]]; then echo "Deleting original file: $filename"
# Create a blank text file rm "$filename"
txt_file="${CONVERTED_FILE%.webp}.txt"
echo -e "" > "$txt_file" else
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}" echo "Error converting $filename"
else fi
echo "Error converting $filename" done
fi
done done

View File

@ -99,6 +99,8 @@ cat > "$OUTPUT_FILE" <<EOL
.modal-card-title { .modal-card-title {
font-family: 'Autour One', cursive; font-family: 'Autour One', cursive;
background-color: transparent !important; background-color: transparent !important;
font-size: 1rem;
} }
.modal-card-body{ .modal-card-body{
display: flex; display: flex;

View File

@ -3,30 +3,56 @@
# Specify the input directory # Specify the input directory
INPUT_DIR="../../assets/pics/gallery/sculpture" INPUT_DIR="../../assets/pics/gallery/sculpture"
# Ensure ImageMagick is installed # Array of image extensions to process (excluding webp)
IMAGE_EXTENSIONS=("*.heic" "*.jpg" "*.jpeg" "*.png" "*.gif")
# Loop through each image extension
for ext in "${IMAGE_EXTENSIONS[@]}"; do
# Find files matching the current extension
for filename in $(find "$INPUT_DIR" -type f -name "$ext"); do
# Determine the output file name based on the original extension
case "$ext" in
*.heic)
CONVERTED_FILE="${filename%.}.webp"
;;
*.jpg|*.jpeg)
CONVERTED_FILE="${filename%.}.webp"
;;
*.png)
CONVERTED_FILE="${filename%.}.webp"
;;
*.gif)
CONVERTED_FILE="${filename%.}.webp"
;;
*) # Default case for unknown file types (if you add more later)
echo "Unknown file type: $filename"
continue # Skip to the next file
;;
esac
for filename in $(find "$INPUT_DIR" -type f -name "*.heic"); do # Skip if already converted
# Define the output file name if [[ -f "$CONVERTED_FILE" ]]; then
CONVERTED_FILE="${filename%.heic}.webp" echo "Skipping $filename, already converted."
continue
fi
# Skip if already converted # Convert to WEBP
if [[ -f "$CONVERTED_FILE" ]]; then echo "Converting $filename to $CONVERTED_FILE..."
echo "Skipping $filename, already converted." convert "$filename" -quality 85 "$CONVERTED_FILE"
continue
fi
# Convert HEIC to WEBP # Verify conversion success
echo "Converting $filename to $CONVERTED_FILE..." if [[ -f "$CONVERTED_FILE" ]]; then
convert "$filename" -quality 85 "$CONVERTED_FILE" # Create a blank text file (caption file)
txt_file="${CONVERTED_FILE%.webp}.txt"
echo -e "" > "$txt_file"
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}"
# Verify conversion success # Delete the original file
if [[ -f "$CONVERTED_FILE" ]]; then echo "Deleting original file: $filename"
# Create a blank text file rm "$filename"
txt_file="${CONVERTED_FILE%.webp}.txt"
echo -e "" > "$txt_file" else
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}" echo "Error converting $filename"
else fi
echo "Error converting $filename" done
fi
done done

View File

@ -99,6 +99,8 @@ cat > "$OUTPUT_FILE" <<EOL
.modal-card-title { .modal-card-title {
font-family: 'Autour One', cursive; font-family: 'Autour One', cursive;
background-color: transparent !important; background-color: transparent !important;
font-size: 1rem;
} }
.modal-card-body{ .modal-card-body{
display: flex; display: flex;