On Thu, 31 Aug 2023 13:41:13 -0400, "Carlos E. R." <robin.listas@gmx.es> wrote:
On 2023-08-31 12:40, Daniel Bauer wrote:
Am 31.08.23 um 18:08 schrieb Daniel Bauer:
since my upgrade to OS 15.5, when running a command line job for imagemagick I get
I/O error : buffer full
The task is finished anyway, as much as I can see, perfect. But on 15.3 I have never seen this message and I wonder what it could mean and how, if so, I could avoid it.
Actually, after googling, I now believe that it's not an imagemagick problem, but comes from the bash...
The "buffer full" occurs for example when running this:
#!/bin/sh for bild in *.JPG do convert "$bild" -quality 50 -verbose "${bild%.JPG}.png" done
(or other similar scripts). The "I/O error : buffer full" appears for each processing image.
I suspect the problem could be in the "bild in *.JPG" wich can convert to a huge command line, and overflows the command line input buffer.
It happens now probably because you have more photos.
I have never seen that on OS 15.3, but now (on 15.5) with all my bash scripts that use imagemagick.
Do I need to adjust buffer size or something? And, if so, how?
If it is what I suspect, you have to replace that line with something else that doesn't list the entire directory in one line. "find" can do that "somehow". I say somehow because I don't remember right now, but someone will with that hint.
First, can the error be reproduced with just a single execution of 'convert'? Like: $ bild=file1.JPG $ convert "$bild" -quality 50 -verbose "${bild%.JPG}.png" If, surprisingly, there is no error, then yes, 'find' can eliminate the long command line expansion: $ find . -maxdepth 1 -name '*.JPG' -exec sh -c 'F={} ;convert "$F" -quality 50 -verbose "${F%.JPG}.png"' \; -- Robert Webb