From: SourceForge.net <no...@so...> - 2004-05-07 23:08:06
|
Bugs item #950121, was opened at 2004-05-08 06:25 Message generated for change (Comment added) made by das You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=950121&group_id=12997 Category: 05. Canvas Items Group: obsolete: 8.4.5 Status: Open Resolution: None Priority: 5 Submitted By: grayfox1 (grayfox1) Assigned to: Daniel A. Steffen (das) Summary: Inserting Big Image in Canvas crashes wish (aqua) Initial Comment: If an image has more than 4k pixels in height or width then trying to add the image to a canvas causes Wish Shell to crash. This is with Tcl/Tk 8.4.5 on Mac OS X 10.3.3 Here is a partial dump: Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x8a0080ff Thread 0 Crashed: 0 com.apple.QD 0x94d4044c GetPMBaseAddr + 0x10 1 com.apple.QD 0x94d391e4 PixMapToNQDPixMap + 0x24 2 com.apple.QD 0x94d3bf7c BitsToPix + 0x160 3 com.apple.QD 0x94d39a04 Stretch + 0x134 4 com.apple.QD 0x94d4ac4c OneSrcOneDst + 0x44 5 com.apple.QD 0x94d40538 BitsDevLoop + 0xcc 6 com.apple.QD 0x94d39568 CommonBits + 0x298 7 com.apple.QD 0x94d41200 StdBits + 0x2b4 8 com.apple.QD 0x94d394e8 CommonBits + 0x218 9 com.apple.QD 0x94d43694 CopyBits + 0x36c 10 com.tcltk.tklibrary 0x0b079584 TkPutImage + 0x290 11 com.tcltk.tklibrary 0x0b0443fc DitherInstance + 0x6f0 12 com.tcltk.tklibrary 0x0b040ab0 ImgPhotoConfigureInstance + 0x1d0 13 com.tcltk.tklibrary 0x0b040de8 ImgPhotoGet + 0x324 14 com.tcltk.tklibrary 0x0b039cac Tk_GetImage + 0x90 15 com.tcltk.tklibrary 0x0b012fa8 ConfigureImage + 0xb4 16 com.tcltk.tklibrary 0x0b012d64 CreateImage + 0xe8 17 com.tcltk.tklibrary 0x0b00cb44 CanvasWidgetCmd + 0x9a8 ---------------------------------------------------------------------- >Comment By: Daniel A. Steffen (das) Date: 2004-05-08 09:08 Message: Logged In: YES user_id=90580 (repost from tcl-mac) I remember this crash from mac classic... it is due to a limitation with QuickDraw Pixmaps, they cannot be more than 4096 pixels wide. The crash occurs in the CopyBits in TkPutImage() right ? I added a panic for this problem in tk mac classic a long time ago: 2002-04-08 Daniel Steffen <da...@us...> * mac/tkMacDraw.c: add panic for overwide TkImages that would crash Tk on mac otherwise. c.f. patch below, but clearly this happened after the mac sources were cloned and adapted for macosx, as tkMacOSXDraw.c doesn't have the panic... at least this same panic should be added there, a better solution would of course be to CopyBits the image in several slices of at most 4096 pixels width. Index: tkMacDraw.c ========================================= ========================== RCS file: /cvsroot/tktoolkit/tk/mac/Attic/tkMacDraw.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -p -r1.8 -r1.8.2.1 --- tkMacDraw.c 14 Dec 1999 06:52:56 -0000 1.8 +++ tkMacDraw.c 8 Apr 2002 09:00:32 -0000 1.8.2.1 @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacDraw.c,v 1.8 1999/12/14 06:52:56 hobbs Exp $ + * RCS: @(#) $Id: tkMacDraw.c,v 1.8.2.1 2002/04/ 08 09:00:32 das Exp $ */ #include "tkInt.h" @@ -370,6 +370,9 @@ TkPutImage( pixmap.pmTable = NULL; pixmap.pmReserved = 0; pixmap.baseAddr = image->data; + if (image->bytes_per_line >= 0x4000) { + panic("TkImage too wide!"); + } pixmap.rowBytes = image->bytes_per_line | 0x8000; CopyBits((BitMap *) &pixmap, &((GrafPtr) destPort)- >portBits, ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=950121&group_id=12997 |