From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10196 invoked by alias); 25 Nov 2004 02:50:01 -0000 Mailing-List: contact xconq7-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: xconq7-owner@sources.redhat.com Received: (qmail 10167 invoked from network); 25 Nov 2004 02:49:57 -0000 Received: from unknown (HELO mailrouter3.execulink.net) (199.166.6.58) by sourceware.org with SMTP; 25 Nov 2004 02:49:57 -0000 Received: from diamond.ansuz.sooke.bc.ca (ppp49.ac3.56k.execulink.com [209.239.3.49]) by mailrouter3.execulink.net (8.11.6/8.11.6) with ESMTP id iAP2nmh16665; Wed, 24 Nov 2004 21:49:49 -0500 Received: from localhost (mskala@localhost) by diamond.ansuz.sooke.bc.ca (8.10.2/8.10.2) with ESMTP id iAP2hx705032; Wed, 24 Nov 2004 21:44:00 -0500 Date: Thu, 25 Nov 2004 07:07:00 -0000 From: mskala@ansuz.sooke.bc.ca To: xconq7@sources.redhat.com, xconq-hackers@lists.sourceforge.net Subject: Fix for "auto-generated images appear as black" bug Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="50987268-310640437-1101350639=:4915" X-SW-Source: 2004/txt/msg01438.txt.bz2 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --50987268-310640437-1101350639=:4915 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-length: 1418 Attached is a patch for imf.c to fix the bug I was talking about. This definitely fixes it in the TCL/TK interface; I haven't tested it with the SDL interface yet. The issue is that many parts of the image data structure are initialized to zeros and then filled in with actual data on demand. In particular, there's a structure called a TkImage which has to be filled in for the image to be used in TK, but doing so depends on the image's palette, and that's supposed to be copied from the image's parent, but the code that does the copying copies it *before* checking whether the palette has been calculated at all. So if the parent's palette hasn't been calculated yet, then the zeros are copied to the child, and even though the parent's palette is calculated later, that doesn't help the child, which is stuck with a zero palette, causing the TkImage code to abort later. Anyway, there are a few lines that have to be re-arranged to fix it, and this patch does that. Other bugs are made more visible by this patch (in particular, the "choose one subimage at random" code doesn't work with shrunken or magnified images), and *really* shrunken images (like, down to a single pixel as used at very low magnificatons) don't happen because of hardcoded limits elsewhere, but at least it's an improvement. -- Matthew Skala mskala@ansuz.sooke.bc.ca Embrace and defend. http://ansuz.sooke.bc.ca/ --50987268-310640437-1101350639=:4915 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=msgtemp Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=msgtemp Content-length: 1347 ZGlmZiAtcjEuMS4xLjEgaW1mLmMNCjc4NCw3ODlkNzgzDQo8ICAgICBpbWcy LT5waXhlbHNpemUgPSBpbWctPnBpeGVsc2l6ZTsNCjwgICAgIGltZzItPnBh bGV0dGUgPSBpbWctPnBhbGV0dGU7DQo8ICAgICBpbWcyLT5yYXdwYWxldHRl ID0gaW1nLT5yYXdwYWxldHRlOw0KPCAgICAgaW1nMi0+bnVtY29sb3JzID0g aW1nLT5udW1jb2xvcnM7DQo8ICAgICAvKiBNYXJrIHRoZSBpbWFnZSBhcyBo YXZpbmcgYmVlbiBjb21wdXRlZCByYXRoZXIgdGhhbiByZWFkIGluLiAqLw0K PCAgICAgaW1nMi0+c3ludGhldGljID0gVFJVRTsNCjc5OWE3OTQsNzk5DQo+ ICAgICBpbWcyLT5waXhlbHNpemUgPSBpbWctPnBpeGVsc2l6ZTsNCj4gICAg IGltZzItPnBhbGV0dGUgPSBpbWctPnBhbGV0dGU7DQo+ICAgICBpbWcyLT5y YXdwYWxldHRlID0gaW1nLT5yYXdwYWxldHRlOw0KPiAgICAgaW1nMi0+bnVt Y29sb3JzID0gaW1nLT5udW1jb2xvcnM7DQo+ICAgICAvKiBNYXJrIHRoZSBp bWFnZSBhcyBoYXZpbmcgYmVlbiBjb21wdXRlZCByYXRoZXIgdGhhbiByZWFk IGluLiAqLw0KPiAgICAgaW1nMi0+c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