update convert scripts and fixed card title size
This commit is contained in:
parent
f6141b0047
commit
81039f5bcf
@ -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"
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -3,12 +3,32 @@
|
|||||||
# 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 filename in $(find "$INPUT_DIR" -type f -name "*.heic"); do
|
for ext in "${IMAGE_EXTENSIONS[@]}"; do
|
||||||
# Define the output file name
|
# Find files matching the current extension
|
||||||
CONVERTED_FILE="${filename%.heic}.webp"
|
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
|
||||||
|
|
||||||
# Skip if already converted
|
# Skip if already converted
|
||||||
if [[ -f "$CONVERTED_FILE" ]]; then
|
if [[ -f "$CONVERTED_FILE" ]]; then
|
||||||
@ -16,17 +36,23 @@ for filename in $(find "$INPUT_DIR" -type f -name "*.heic"); do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Convert HEIC to WEBP
|
# Convert to WEBP
|
||||||
echo "Converting $filename to $CONVERTED_FILE..."
|
echo "Converting $filename to $CONVERTED_FILE..."
|
||||||
convert "$filename" -quality 85 "$CONVERTED_FILE"
|
convert "$filename" -quality 85 "$CONVERTED_FILE"
|
||||||
|
|
||||||
# Verify conversion success
|
# Verify conversion success
|
||||||
if [[ -f "$CONVERTED_FILE" ]]; then
|
if [[ -f "$CONVERTED_FILE" ]]; then
|
||||||
# Create a blank text file
|
# Create a blank text file (caption file)
|
||||||
txt_file="${CONVERTED_FILE%.webp}.txt"
|
txt_file="${CONVERTED_FILE%.webp}.txt"
|
||||||
echo -e "" > "$txt_file"
|
echo -e "" > "$txt_file"
|
||||||
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}"
|
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}"
|
||||||
|
|
||||||
|
# Delete the original file
|
||||||
|
echo "Deleting original file: $filename"
|
||||||
|
rm "$filename"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Error converting $filename"
|
echo "Error converting $filename"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
done
|
||||||
@ -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;
|
||||||
|
|||||||
@ -3,12 +3,32 @@
|
|||||||
# 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 filename in $(find "$INPUT_DIR" -type f -name "*.heic"); do
|
for ext in "${IMAGE_EXTENSIONS[@]}"; do
|
||||||
# Define the output file name
|
# Find files matching the current extension
|
||||||
CONVERTED_FILE="${filename%.heic}.webp"
|
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
|
||||||
|
|
||||||
# Skip if already converted
|
# Skip if already converted
|
||||||
if [[ -f "$CONVERTED_FILE" ]]; then
|
if [[ -f "$CONVERTED_FILE" ]]; then
|
||||||
@ -16,17 +36,23 @@ for filename in $(find "$INPUT_DIR" -type f -name "*.heic"); do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Convert HEIC to WEBP
|
# Convert to WEBP
|
||||||
echo "Converting $filename to $CONVERTED_FILE..."
|
echo "Converting $filename to $CONVERTED_FILE..."
|
||||||
convert "$filename" -quality 85 "$CONVERTED_FILE"
|
convert "$filename" -quality 85 "$CONVERTED_FILE"
|
||||||
|
|
||||||
# Verify conversion success
|
# Verify conversion success
|
||||||
if [[ -f "$CONVERTED_FILE" ]]; then
|
if [[ -f "$CONVERTED_FILE" ]]; then
|
||||||
# Create a blank text file
|
# Create a blank text file (caption file)
|
||||||
txt_file="${CONVERTED_FILE%.webp}.txt"
|
txt_file="${CONVERTED_FILE%.webp}.txt"
|
||||||
echo -e "" > "$txt_file"
|
echo -e "" > "$txt_file"
|
||||||
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}"
|
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}"
|
||||||
|
|
||||||
|
# Delete the original file
|
||||||
|
echo "Deleting original file: $filename"
|
||||||
|
rm "$filename"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Error converting $filename"
|
echo "Error converting $filename"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
done
|
||||||
@ -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;
|
||||||
|
|||||||
@ -3,12 +3,32 @@
|
|||||||
# 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 filename in $(find "$INPUT_DIR" -type f -name "*.heic"); do
|
for ext in "${IMAGE_EXTENSIONS[@]}"; do
|
||||||
# Define the output file name
|
# Find files matching the current extension
|
||||||
CONVERTED_FILE="${filename%.heic}.webp"
|
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
|
||||||
|
|
||||||
# Skip if already converted
|
# Skip if already converted
|
||||||
if [[ -f "$CONVERTED_FILE" ]]; then
|
if [[ -f "$CONVERTED_FILE" ]]; then
|
||||||
@ -16,17 +36,23 @@ for filename in $(find "$INPUT_DIR" -type f -name "*.heic"); do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Convert HEIC to WEBP
|
# Convert to WEBP
|
||||||
echo "Converting $filename to $CONVERTED_FILE..."
|
echo "Converting $filename to $CONVERTED_FILE..."
|
||||||
convert "$filename" -quality 85 "$CONVERTED_FILE"
|
convert "$filename" -quality 85 "$CONVERTED_FILE"
|
||||||
|
|
||||||
# Verify conversion success
|
# Verify conversion success
|
||||||
if [[ -f "$CONVERTED_FILE" ]]; then
|
if [[ -f "$CONVERTED_FILE" ]]; then
|
||||||
# Create a blank text file
|
# Create a blank text file (caption file)
|
||||||
txt_file="${CONVERTED_FILE%.webp}.txt"
|
txt_file="${CONVERTED_FILE%.webp}.txt"
|
||||||
echo -e "" > "$txt_file"
|
echo -e "" > "$txt_file"
|
||||||
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}"
|
echo "Successfully converted $filename to $CONVERTED_FILE and created ${txt_file}"
|
||||||
|
|
||||||
|
# Delete the original file
|
||||||
|
echo "Deleting original file: $filename"
|
||||||
|
rm "$filename"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Error converting $filename"
|
echo "Error converting $filename"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
done
|
||||||
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user