diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2011-03-12 03:09:30 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2011-03-12 03:09:30 +0000 |
commit | 1b5dbe4af5107e811ea9c1cf6bb96fdffce7d5fc (patch) | |
tree | 0333a40d380b83c153f84f9a68bef6cb48e9919e | |
parent | 3f7f181714ab33d18bd53cf45fc0391424ac1357 (diff) | |
download | netpbm-mirror-1b5dbe4af5107e811ea9c1cf6bb96fdffce7d5fc.tar.gz netpbm-mirror-1b5dbe4af5107e811ea9c1cf6bb96fdffce7d5fc.tar.xz netpbm-mirror-1b5dbe4af5107e811ea9c1cf6bb96fdffce7d5fc.zip |
Add warning for interlaced PNG and -byrow, -byrow advice for failed buffer allocation
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1430 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r-- | converter/other/pngtopam.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/converter/other/pngtopam.c b/converter/other/pngtopam.c index 635c8aa0..eab946ea 100644 --- a/converter/other/pngtopam.c +++ b/converter/other/pngtopam.c @@ -278,13 +278,15 @@ allocPngRaster(struct pngx * const pngxP, MALLOCARRAY(pngImage, pngxP->info_ptr->height); if (pngImage == NULL) - pm_error("couldn't allocate space for %u PNG raster rows", + pm_error("couldn't allocate index space for %u PNG raster rows. " + "Try -byrow, which needs only 1 row of buffer space. ", (unsigned int)pngxP->info_ptr->height); for (row = 0; row < pngxP->info_ptr->height; ++row) { MALLOCARRAY(pngImage[row], lineSize); if (pngImage[row] == NULL) - pm_error("couldn't allocate space for %uth row of PNG raster", + pm_error("couldn't allocate space for %uth row of PNG raster. " + "Try -byrow, which needs only 1 row of buffer space. ", row); } *pngImageP = pngImage; @@ -385,6 +387,11 @@ reader_createRowByRow(struct pngx * const pngxP, readerP->nextRowNum = 0; + if (pngxP->info_ptr->interlace_type != PNG_INTERLACE_NONE) + pm_message("WARNING: this is an interlaced PNG. The PAM output " + "will be interlaced. To get proper output, " + "don't use -byrow"); + return readerP; } |