mirror of
https://github.com/CosmicScale/PSBBN-Definitive-English-Patch.git
synced 2025-02-11 10:38:50 +01:00
Updated art converter
This commit is contained in:
parent
97bc4291cb
commit
4a966e1f38
@ -511,9 +511,16 @@ if compgen -G "${input_dir}/*" > /dev/null; then
|
|||||||
|
|
||||||
# Check if width >= 256 and height >= width
|
# Check if width >= 256 and height >= width
|
||||||
if [[ $width -ge 256 && $height -ge $width ]]; then
|
if [[ $width -ge 256 && $height -ge $width ]]; then
|
||||||
# Convert each file to .png with resizing and 8-bit depth
|
# Determine whether the image is square
|
||||||
echo "Converting $file"
|
if [[ $width -eq $height ]]; then
|
||||||
convert "$file" -resize 256x256^ -gravity center -extent 256x256 -depth 8 -alpha off "$output" | tee -a "${LOG_FILE}"
|
# Square: Resize without cropping
|
||||||
|
echo "Resizing square image $file"
|
||||||
|
convert "$file" -resize 256x256! -depth 8 -alpha off "$output"
|
||||||
|
else
|
||||||
|
# Not square: Resize and crop
|
||||||
|
echo "Resizing and cropping $file"
|
||||||
|
convert "$file" -resize 256x256^ -crop 256x256+0+44 -depth 8 -alpha off "$output"
|
||||||
|
fi
|
||||||
rm "$file"
|
rm "$file"
|
||||||
else
|
else
|
||||||
echo "Skipping $file: does not meet size requirements" | tee -a "${LOG_FILE}"
|
echo "Skipping $file: does not meet size requirements" | tee -a "${LOG_FILE}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user