Re: Inconsistent out of disk space behavior
Przemysław Sobala <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <[email protected]> |
W dniu 16.10.2017 o 15:41, Bob Friesenhahn pisze: > On Mon, 16 Oct 2017, Przemysław Sobala wrote: >> Can something be done to always report error / exception in C++ API? > > It is likely that things can be done better. An existing factor is > that some formats are using external libraries (e.g. libjpeg, libpng, > libwebp) and these provide their own error handling and reporting, > even if they use I/O wrappers provided by GraphicsMagick. These > libraries often produce their own error codes and error strings which > are not necessarily aligned or mapped into GraphicsMagick's own codes. > > Formats like GIF are totally under GraphicsMagick control so there is > no excuse if it does not report the problem, as long as the underlying > operating system adequately reported it. I think that GraphicsMagick > should be able to report a useful error for WebP since it is > responsible for writing the output from it. > > Bob Hi Bob, Thanks for quick response. I looked at the libwebp usage, because that's the most interesting for me at the moment, and came out with a small change: $ hg diff coders/webp.c diff -r 19f1771574cc coders/webp.c --- a/coders/webp.c Tue Aug 01 08:40:21 2017 -0500 +++ b/coders/webp.c Mon Oct 16 16:50:49 2017 +0200 @@ -419,7 +419,7 @@ *image; image=(Image *) picture->custom_ptr; - return (length != 0 ? (int) WriteBlob(image,length,stream) : 1); + return (length != 0 ? (WriteBlob(image,length,stream) == length) : 1); } /* Similarly to https://github.com/webmproject/libwebp/blob/master/examples/cwebp.c#L291 The output now looks like this: $ utilities/gm convert big_tree_q80.jpg /tmp/smalltmp/gm.webp utilities/gm convert: WebP encoding failed: unknown reason (/tmp/smalltmp/gm.webp) [No space left on device]. What do you thing about that? -- Regards Przemysław Sobala ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Graphicsmagick-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help