diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-03-08 15:16:57 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-03-08 15:16:57 (GMT) |
commit | 2f06f93f705ba316b0374ad2742cfe49227b1aeb (patch) | |
tree | 06280fa14c170fcb1e2ec950550ba8a0991c2ee3 /generic | |
parent | 0a9213075871ce2995c09448b33795b1ae53118e (diff) | |
parent | a5e4b9f2e248af1d2b1d0e70a5cee6db6088bcd3 (diff) | |
download | tk-2f06f93f705ba316b0374ad2742cfe49227b1aeb.zip tk-2f06f93f705ba316b0374ad2742cfe49227b1aeb.tar.gz tk-2f06f93f705ba316b0374ad2742cfe49227b1aeb.tar.bz2 |
Merge 8.6
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkImgGIF.c | 6 | ||||
-rw-r--r-- | generic/tkImgPNG.c | 26 | ||||
-rw-r--r-- | generic/tkImgPhoto.c | 12 |
3 files changed, 22 insertions, 22 deletions
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 8702970..b9b5273 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -771,7 +771,7 @@ FileReadGIF( result = TCL_OK; error: - + /* * If a trash buffer has been allocated, free it now. */ @@ -1996,11 +1996,11 @@ CommonWriteGIF( */ if (NULL != metadataInObj) { Tcl_Obj *itemData; - + /* * Check and code comment block */ - + if (TCL_ERROR == Tcl_DictObjGet(interp, metadataInObj, Tcl_NewStringObj("comment",-1), &itemData)) { diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index 5fd741c..69c2739 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -180,7 +180,7 @@ typedef struct { /* * Physical size: pHYS chunks. */ - + double DPI; double aspect; @@ -361,11 +361,11 @@ InitPNGImage( } return TCL_ERROR; } - + /* * Initialize physical size pHYS values */ - + pngPtr->DPI = -1; pngPtr->aspect = -1; @@ -1710,7 +1710,7 @@ ReadPHYS( * 4 bytes: Pixels per unit, y axis * 1 byte: unit specifier */ - + if (ReadInt32(interp, pngPtr, &PPUx, &crc) == TCL_ERROR) { return TCL_ERROR; } @@ -1724,7 +1724,7 @@ ReadPHYS( if (CheckCRC(interp, pngPtr, crc) == TCL_ERROR) { return TCL_ERROR; } - + if ( PPUx > 2147483647 || PPUy > 2147483647 || unitSpecifier > 1 ) { Tcl_SetObjResult(interp, Tcl_NewStringObj( @@ -2520,7 +2520,7 @@ DecodePNG( /* * Physical header may be present here so try to parse it */ - + if (CHUNK_pHYs == chunkType) { /* * Finish parsing the PHYS chunk. @@ -2593,7 +2593,7 @@ DecodePNG( /* * Physical header may be present here so try to parse it */ - + if (CHUNK_pHYs == chunkType) { /* * Finish parsing the PHYS chunk. @@ -3509,7 +3509,7 @@ WriteExtraChunks( return TCL_ERROR; } Tcl_DStringFree(&buf); - + /* * Add a pHYs chunk if there is metadata for DPI and/or aspect * aspect = PPUy / PPUx @@ -3519,14 +3519,14 @@ WriteExtraChunks( * - Points per meter in x direction (32 bit) * - Unit specifier: 0: no unit (only aspect), 1: Points per meter */ - + if (metadataInObj != NULL) { - + Tcl_Obj *aspectObj, *DPIObj; double aspectValue=-1, DPIValue=-1; unsigned long PPUx = 65536, PPUy = 65536; char unitSpecifier; - + if (TCL_ERROR == Tcl_DictObjGet(interp, metadataInObj, Tcl_NewStringObj("aspect",-1), &aspectObj) || @@ -3555,7 +3555,7 @@ WriteExtraChunks( /* * aspect = PPUy / PPUx */ - + if (DPIObj == NULL) { unitSpecifier = 0; PPUx = 65536; @@ -3573,7 +3573,7 @@ WriteExtraChunks( Tcl_SetErrorCode(interp, "TK", "IMAGE", "PNG", "PHYS", NULL); return TCL_ERROR; } - + LongToInt32(PPUx, buffer); LongToInt32(PPUy, buffer+4); buffer[8] = unitSpecifier; diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 5352a15..cc4f412 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -799,11 +799,11 @@ ImgPhotoCmd( options.format = Tcl_NewStringObj("default", -1); freeObj = options.format; } - + /* * Use argument metadata if specified, otherwise the master metadata */ - + if (NULL != options.metadata) { metadataIn = options.metadata; } else { @@ -1468,11 +1468,11 @@ readCleanup: usedExt = 0; } - + /* * Use argument metadata if specified, otherwise the master metadata */ - + if (NULL != options.metadata) { metadataIn = options.metadata; } else { @@ -2273,7 +2273,7 @@ ImgPhotoConfigureModel( /* * We have driver return metadata */ - + if (modelPtr->metadata == NULL) { modelPtr->metadata = metadataOutObj; metadataOutObj = NULL; @@ -2880,7 +2880,7 @@ if (formatPtr == NULL) { } } } - + /* * No matching format found */ |