This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix for "auto-generated images appear as black" bug


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/

Attachment: msgtemp
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]