Menu

#775 crop +repage +adjoin Generate Only One Image

v1.0_(example)
open
nobody
None
5
2026-08-05
2026-08-05
Peido
No

Version
~$ convert -version
GraphicsMagick 1.3.42 2023-09-23 Q16 http://www.GraphicsMagick.org/
Copyright (C) 2002-2023 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.
Feature Support:
Native Thread Safe yes
Large Files (> 32 bit) yes
Large Memory (> 32 bit) yes
BZIP yes
DPS no
FlashPix no
FreeType yes
Ghostscript (Library) no
HEIF/HVEC ("HEIC") yes
JBIG yes
JPEG-2000 no
JPEG yes
JPEG XL yes
Little CMS yes
Loadable Modules no
Solaris mtmalloc no
Google perftools tcmalloc no
OpenMP yes (201511 "4.5")
PNG yes
TIFF yes
TRIO no
Solaris umem no
WebP yes
WMF yes
X11 yes
XML yes
ZLIB yes
Host type: x86_64-pc-linux-gnu
Configured using the command:
./configure '--build' 'x86_64-linux-gnu' '--enable-shared' '--enable-static' '--enable-libtool-verbose' '--prefix=/usr' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--docdir=${prefix}/share/doc/graphicsmagick' '--with-gs-font-dir=/usr/share/fonts/type1/gsfonts' '--with-x' '--without-dps' '--without-modules' '--without-frozenpaths' '--with-webp=yes' '--with-zstd=yes' '--with-perl' '--with-perl-options=INSTALLDIRS=vendor' '--enable-quantum-library-names' '--with-quantum-depth=16' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/build/graphicsmagick-kB3n8T/graphicsmagick-1.4+really1.3.42=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/build/graphicsmagick-kB3n8T/graphicsmagick-1.4+really1.3.42=/usr/src/graphicsmagick-1.4+really1.3.42-1.1build3' 'LDFLAGS=-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,
Final Build Parameters:
CC = gcc
CFLAGS = -fopenmp -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/build/graphicsmagick-kB3n8T/graphicsmagick-1.4+really1.3.42=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/build/graphicsmagick-kB3n8T/graphicsmagick-1.4+really1.3.42=/usr/src/graphicsmagick-1.4+really1.3.42-1.1build3 -Wall
CPPFLAGS = -Wdate-time -D_FORTIFY_SOURCE=3 -I/usr/include/freetype2 -I/usr/include/libxml2
CXX = g++
CXXFLAGS = -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/build/graphicsmagick-kB3n8T/graphicsmagick-1.4+really1.3.42=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/build/graphicsmagick-kB3n8T/graphicsmagick-1.4+really1.3.42=/usr/src/graphicsmagick-1.4+really1.3.42-1.1build3
LDFLAGS = -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now
LIBS = -ljbig -lwebp -lwebpmux -lsharpyuv -lheif -llcms2 -ltiff -lfreetype -ljpeg -ljxl -ljxl_threads -lhwy -lbrotlidec -lbrotlienc -lstdc++ -lpng16 -lwmflite -lXext -lSM -lICE -lX11 -llzma -lbz2 -lxml2 -lz -lzstd -lm -lpthread

Operating system, version and so on
Linux Mint 22 Xfce

Description
Using the following commands will only generate one image instead of 5 images:
convert "/path/image" +adjoin -crop 20%x100% +repage "/path/image_%d"
convert "/path/image" +adjoin -crop 100%x20% +repage "/path/image_%d"
WIDTH=$(identify -format "%w" "/path/image") && SPLIT=$((WIDTH / 5)) && HEIGHT=$(identify -format "%h" "/path/image") && convert "/path/image" -crop $SPLITx$HEIGHT +repage +adjoin "/path/image_%d"
HEIGHT=$(identify -format "%h" "/path/image") && SPLIT=$((HEIGHT / 5)) && WIDTH=$(identify -format "%w" "/path/image") && convert "/path/image" -crop $WIDTHx$SPLIT +repage +adjoin "/path/image_%d"

Steps to Reproduce
Just use the commands on the terminal.
I've tried several sized PNGs and JPGs.
I've also tried using 1x5@ ou 5x1@ instead of % or pixels, but this always resulted on "convert: geometry dimensions are zero (unable to crop image).".

I'm attaching one of the images that I used to test.

1 Attachments

Discussion


Log in to post a comment.