Tk Source Code

Check-in [b810ad86]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix StringReadPPM function from previous commit.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: b810ad861d57bb962ecdac5e76a72f368925726b
User & Date: jan.nijtmans 2013-11-03 16:49:10
Context
2013-11-03
19:55
Improved tests to cover StringReadPPM properly. check-in: 3db28efe user: dkf tags: core-8-5-branch
16:49
Fix StringReadPPM function from previous commit check-in: fb1fb2fd user: jan.nijtmans tags: trunk
16:49
Fix StringReadPPM function from previous commit. check-in: b810ad86 user: jan.nijtmans tags: core-8-5-branch
11:29
[1632447]: Allow the PPM maxval to go up to 65535, to conform with a format definition change from around 2000 (even if that's a rare format). check-in: 85a3e256 user: dkf tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkImgPPM.c.

481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
				 * image to be written to. */
    int width, int height,	/* Dimensions of block of photo image to be
				 * written to. */
    int srcX, int srcY)		/* Coordinates of top-left pixel to be used in
				 * image being read. */
{
    int fileWidth, fileHeight, maxIntensity;
    int nLines, nBytes, h, type, count, dataSize, bytesPerChannel = 2;
    unsigned char *pixelPtr, *dataBuffer;
    Tk_PhotoImageBlock block;

    type = ReadPPMStringHeader(dataObj, &fileWidth, &fileHeight,
	    &maxIntensity, &dataBuffer, &dataSize);
    if (type == 0) {
	Tcl_AppendResult(interp, "couldn't read raw PPM header from string",







|







481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
				 * image to be written to. */
    int width, int height,	/* Dimensions of block of photo image to be
				 * written to. */
    int srcX, int srcY)		/* Coordinates of top-left pixel to be used in
				 * image being read. */
{
    int fileWidth, fileHeight, maxIntensity;
    int nLines, nBytes, h, type, count, dataSize, bytesPerChannel = 1;
    unsigned char *pixelPtr, *dataBuffer;
    Tk_PhotoImageBlock block;

    type = ReadPPMStringHeader(dataObj, &fileWidth, &fileHeight,
	    &maxIntensity, &dataBuffer, &dataSize);
    if (type == 0) {
	Tcl_AppendResult(interp, "couldn't read raw PPM header from string",