Image Conversion Limited to 100 files? (Windows)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
redruin
Posts: 2
Joined: 2019-01-28T06:47:50-07:00
Authentication code: 1152

Image Conversion Limited to 100 files? (Windows)

Post by redruin »

Hi, I have been attempting to use Imagemagick to automate some basic image manipulation. I am reducing the width and height of each image using the shave command, taking one pixel off all sides. The command I am using is as follows:

Code: Select all

magick convert 3_?_?.* -shave 1x1 montage_%d.png
This command works fine as long as the total number of input images are less than or equal to 100, numbering the output images in the range "montage_0.png" to "montage_99.png". However, the command refuses to exceed this limit. Changing the percent character to "%f" changes the format to hexadecimal, but the total file amount is still capped at 100. When researching, I noticed that there is a environment variable MAGICK_LIST_LENGTH_LIMIT which seems to be what I am after, but it is unclear to me how I would change this parameter. I tried adding said parameter to configure.xml but it didn't seem to have any affect. Is this parameter the limit that I am experiencing? If so, why is it limited to 100 images by default? How would I change this parameter to something like, say, 256?

If it is relevant, I am running this from a Powershell script in conjunction with other commands but even when written directly into the command line I still get the image limit. I used the default Windows precompiled binary with the installer. My magick version is the latest posted, 7.0.8-25-Q16 64 bit.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image Conversion Limited to 100 files? (Windows)

Post by snibgo »

I suggest you use "magick", not "magick convert".

Your command reads all the input images into memory, then processes each one. You may be hitting a memory limit.

Use "magick -list resource" to see the current limits.
snibgo's IM pages: im.snibgo.com
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Image Conversion Limited to 100 files? (Windows)

Post by GeeMack »

redruin wrote: 2019-01-28T07:16:10-07:00The command I am using is as follows:

Code: Select all

magick convert 3_?_?.* -shave 1x1 montage_%d.png
This command works fine as long as the total number of input images are less than or equal to 100,...
The Windows wildcard "?" substitutes for any single character. If the characters at those wildcard positions in the file names are numbers, your command as written will only do "3_0_0.*" through "3_9_9.*". You may have to come up with another way to specify which files to process.

Are all the images the same format or end with the same file name extension, like ".jpg" or ".png", etc.?
redruin
Posts: 2
Joined: 2019-01-28T06:47:50-07:00
Authentication code: 1152

Re: Image Conversion Limited to 100 files? (Windows)

Post by redruin »

Thanks snigbo and GeeMack. Indeed, you are correct about the wildcard characters; I should have suspected why the total number of images was exactly 100. I am using this command to process a batch of files all at once, and while each one in that batch has the same file format (either jpg or png), each batch could be either, which is why I chose to put a "*" as the filename to account for both cases. The command

Code: Select all

magick convert 3_*_*.* -shave 1x1 montage_%d.png
converts all the required images perfectly. Thanks for also suggesting the memory as a problem, the images I am editing are pretty small though and I think I should be good for the number of images I am currently working with.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image Conversion Limited to 100 files? (Windows)

Post by fmw42 »

For IM 7, use magick, not magick convert and not convert.
Post Reply