Use right resolution for vertical pages
This commit is contained in:
parent
9ebd8f4936
commit
687e9e0812
10
cbz2ebook.sh
10
cbz2ebook.sh
|
@ -1,8 +1,10 @@
|
||||||
#!/bin/zsh -i
|
#!/bin/zsh -i
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SIZE="1440x1920" # Kobo Forma
|
size="1440x1920" # Kobo Forma
|
||||||
#SIZE="768x1024" # Amazon Kindle Paperwhite
|
#size="768x1024" # Amazon Kindle Paperwhite
|
||||||
|
|
||||||
|
vertical_size="$(cut -dx -f2 <<< $size)x$(cut -dx -f1 <<< $size)"
|
||||||
|
|
||||||
infile="$(realpath $1)"
|
infile="$(realpath $1)"
|
||||||
outfile="$(realpath $2)"
|
outfile="$(realpath $2)"
|
||||||
|
@ -23,9 +25,9 @@ for image in **/*; do
|
||||||
width=$(identify -format "%W" "$image")
|
width=$(identify -format "%W" "$image")
|
||||||
height=$(identify -format "%H" "$image")
|
height=$(identify -format "%H" "$image")
|
||||||
if (($width > $height)); then
|
if (($width > $height)); then
|
||||||
mogrify -resize "$SIZE" -rotate 270 "$image"
|
mogrify -resize "$vertical_size" -rotate 270 "$image"
|
||||||
else
|
else
|
||||||
mogrify -resize "$SIZE" "$image"
|
mogrify -resize "$size" "$image"
|
||||||
fi
|
fi
|
||||||
position=$(($position + 1))
|
position=$(($position + 1))
|
||||||
echo -ne "$(printf '%3s' $((100 * $position / $length))) % "$(printf "%0*d" "$((72 * $position / $length))" 0 | tr '0' '#')'\r'
|
echo -ne "$(printf '%3s' $((100 * $position / $length))) % "$(printf "%0*d" "$((72 * $position / $length))" 0 | tr '0' '#')'\r'
|
||||||
|
|
Loading…
Reference in a new issue