1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00

Medie: added split image tasks

This commit is contained in:
Tony Tkáčik 2024-05-06 10:58:58 +02:00
parent 82b0df6549
commit e2b160d7c9

View file

@ -111,6 +111,20 @@ nux.log debug "FFMPEG: $FFMPEG_OR_LIBAV Magick: $NUX_MAGICK"
nux.fs.info "$output" "Created"
}
@command split-horizontally image {
suffix=${image##*.}
basename=${image%.*}
$NUX_MAGICK convert "$image" -gravity east -chop 50%x0% "$basename.1.$suffix"
$NUX_MAGICK convert "$image" -gravity west -chop 50%x0% "$basename.2.$suffix"
}
@command split-vertically image {
suffix=${image##*.}
basename=${image%.*}
$NUX_MAGICK convert "$image" -gravity north -chop 0%x50% "$basename.1.$suffix"
$NUX_MAGICK convert "$image" -gravity south -chop 0%x50% "$basename.2.$suffix"
}
## list-smaller:: <size> <image...>
## Lists images smaller than **size**.
@command list-smaller size {