diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-01-08 22:50:25 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-01-08 22:50:25 +0000 |
commit | 6c605ff4ae0b4570877b25a62020510d816322f1 (patch) | |
tree | cf29f85c58fc66ae43ed9dca5e57f6d82545448b /converter/ppm | |
parent | 3e299554f87c14b780ad6e83e516a94dc2462622 (diff) | |
download | netpbm-mirror-6c605ff4ae0b4570877b25a62020510d816322f1.tar.gz netpbm-mirror-6c605ff4ae0b4570877b25a62020510d816322f1.tar.xz netpbm-mirror-6c605ff4ae0b4570877b25a62020510d816322f1.zip |
Add verbose messages
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4232 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/ppm')
-rw-r--r-- | converter/ppm/picttoppm.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/converter/ppm/picttoppm.c b/converter/ppm/picttoppm.c index e1c30d79..c2d1ee24 100644 --- a/converter/ppm/picttoppm.c +++ b/converter/ppm/picttoppm.c @@ -141,18 +141,18 @@ struct Rect { struct PixMap { struct Rect Bounds; - Word version; - Word packType; - Longword packSize; - Longword hRes; - Longword vRes; - Word pixelType; - Word pixelSize; - Word cmpCount; - Word cmpSize; - Longword planeBytes; - Longword pmTable; - Longword pmReserved; + Word version; + Word packType; + Longword packSize; + Longword hRes; + Longword vRes; + Word pixelType; + Word pixelSize; + Word cmpCount; + Word cmpSize; + Longword planeBytes; + Longword pmTable; + Longword pmReserved; }; struct RGBColor { @@ -2366,7 +2366,7 @@ expand1Bit(unsigned char * const packed, static void unpackBuf(unsigned char * const packed, unsigned int const packedLen, - int const bitsPerPixel, + unsigned int const bitsPerPixel, unsigned char ** const expandedP, unsigned int * const expandedLenP) { /*---------------------------------------------------------------------------- @@ -2437,6 +2437,9 @@ unpackUncompressedBits(FILE * const ifP, unsigned int rowOfRect; unsigned char * linebuf; + if (verbose) + pm_message("Bits are compressed"); + MALLOCARRAY(linebuf, rowBytes + 100); if (linebuf == NULL) pm_error("can't allocate memory for line buffer"); @@ -2770,6 +2773,9 @@ unpackCompressedBits(FILE * const ifP, unsigned char * linebuf; unsigned int linebufSize; + if (verbose) + pm_message("Bits are compressed"); + linebufSize = rowBytes; MALLOCARRAY(linebuf, linebufSize); if (linebuf == NULL) @@ -2807,7 +2813,7 @@ static void unpackbits(FILE * const ifP, struct Rect * const boundsP, Word const rowBytesArg, - int const bitsPerPixel, + unsigned int const bitsPerPixel, struct Raster * const rasterP) { unsigned int const rectHeight = boundsP->bottom - boundsP->top; @@ -2819,7 +2825,7 @@ unpackbits(FILE * const ifP, stage = "unpacking packbits"; if (verbose) - pm_message("rowBytes = %u, bitsPerPixel = %d", + pm_message("rowBytes = %u, bitsPerPixel = %u", rowBytesArg, bitsPerPixel); allocateRaster(&raster, rectWidth, rectHeight, bitsPerPixel); |