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
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"

View File

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

View File

@ -3,30 +3,56 @@
# Specify the input directory
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
# Define the output file name
CONVERTED_FILE="${filename%.heic}.webp"
# Skip if already converted
if [[ -f "$CONVERTED_FILE" ]]; then
echo "Skipping $filename, already converted."
continue
fi
# Skip if already converted
if [[ -f "$CONVERTED_FILE" ]]; then
echo "Skipping $filename, already converted."
continue
fi
# Convert to WEBP
echo "Converting $filename to $CONVERTED_FILE..."
convert "$filename" -quality 85 "$CONVERTED_FILE"
# Convert HEIC to WEBP
echo "Converting $filename to $CONVERTED_FILE..."
convert "$filename" -quality 85 "$CONVERTED_FILE"
# Verify conversion success
if [[ -f "$CONVERTED_FILE" ]]; then
# 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
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
# Delete the original file
echo "Deleting original file: $filename"
rm "$filename"
else
echo "Error converting $filename"
fi
done
done

View File

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

View File

@ -3,30 +3,56 @@
# Specify the input directory
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
# Define the output file name
CONVERTED_FILE="${filename%.heic}.webp"
# Skip if already converted
if [[ -f "$CONVERTED_FILE" ]]; then
echo "Skipping $filename, already converted."
continue
fi
# Skip if already converted
if [[ -f "$CONVERTED_FILE" ]]; then
echo "Skipping $filename, already converted."
continue
fi
# Convert to WEBP
echo "Converting $filename to $CONVERTED_FILE..."
convert "$filename" -quality 85 "$CONVERTED_FILE"
# Convert HEIC to WEBP
echo "Converting $filename to $CONVERTED_FILE..."
convert "$filename" -quality 85 "$CONVERTED_FILE"
# Verify conversion success
if [[ -f "$CONVERTED_FILE" ]]; then
# 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
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
# Delete the original file
echo "Deleting original file: $filename"
rm "$filename"
else
echo "Error converting $filename"
fi
done
done

View File

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

View File

@ -3,30 +3,56 @@
# Specify the input directory
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
# Define the output file name
CONVERTED_FILE="${filename%.heic}.webp"
# Skip if already converted
if [[ -f "$CONVERTED_FILE" ]]; then
echo "Skipping $filename, already converted."
continue
fi
# Skip if already converted
if [[ -f "$CONVERTED_FILE" ]]; then
echo "Skipping $filename, already converted."
continue
fi
# Convert to WEBP
echo "Converting $filename to $CONVERTED_FILE..."
convert "$filename" -quality 85 "$CONVERTED_FILE"
# Convert HEIC to WEBP
echo "Converting $filename to $CONVERTED_FILE..."
convert "$filename" -quality 85 "$CONVERTED_FILE"
# Verify conversion success
if [[ -f "$CONVERTED_FILE" ]]; then
# 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
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
# Delete the original file
echo "Deleting original file: $filename"
rm "$filename"
else
echo "Error converting $filename"
fi
done
done

View File

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