[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensuse
Subject:    Re: should probably be: BASH_SCRIPT I/O error : buffer full
From:       Daniel Bauer <linux () daniel-bauer ! com>
Date:       2023-09-01 8:39:06
Message-ID: 3097619a-0661-4b2e-a569-578c029635c1 () daniel-bauer ! com
[Download RAW message or body]



Am 01.09.23 um 09:59 schrieb Robert Webb via openSUSE Users:
> 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"

Yes, the error occurs also with the above.
It also occurs when I use filenames directly:

$ convert _MG_0321.JPG -quality 50 -verbose _MG_0321.png
I/O error : buffer full
writing raw profile: type=icc, length=560
writing raw profile: type=xmp, length=8192
_MG_0321.JPG=>_MG_0321.png JPEG 4590x6885 4590x6885+0+0 8-bit sRGB 
13.9185MiB 5.460u 0:05.459


> 
> 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

-- 
Daniel Bauer photographer Basel Málaga
Twitter: @Marsfotografo (often explicit nudes)
https://www.patreon.com/danielbauer
https://www.daniel-bauer.com (nudes)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic