[comp.sys.amiga] Dpaint III creates bas IFF files!! Info and solution.

elec@pnet51.orb.mn.org (Doug Renner) (02/23/90)

Yes - it is true, and I have several bad files in front of me now.
I have one file, 19252 bytes long, that when fixed (by the method I'll
describe) has a proper length of 5352 bytes.  In other words, DPaint
saved an extra 13850 bytes of GARBAGE at the end of it.   YECCHHHH!
 
This bug in DPaint III not only lengthens your files, but also renders them
unreadable by many (but not all) IFF readers.
 
To fix the files, you can load them into an older version of DPaint such as
DPaint II, and save them out again.  Because of the hundreds of files affected
where I work, I have had to write a short utility to fix entire directories
of bad files.  If there is interest, I can post this utility.
 
The logic goes like this:
        if ((length of FORM chunk) == (length of IFF file -8))
                  then it's a good file
        else
                  open a new file, and copy FORM length+8 bytes into it
                  from the original file.
 
And that should do it. 
 
Once again, the problem is  garbage appended to the end of the file.  Remove
the garbage, and the file will work with all readers, and not just EA's
reader.
 
-Douglas Renner-

UUCP: {amdahl!bungia, uunet!rosevax, chinet, killer}!orbit!pnet51!elec
ARPA: crash!orbit!pnet51!elec@nosc.mil
INET: elec@pnet51.cts.com

new@udel.edu (Darren New) (02/27/90)

In article <2081@orbit.cts.com> elec@pnet51.orb.mn.org (Doug Renner) writes:
>Yes - it is true, and I have several bad files in front of me now.
>In other words, DPaint saved an extra 13850 bytes of GARBAGE at the end 

Technically, this is OK.  Specifically, it is OK because not all OSes
keep exact byte counts of file lengths.  However, I agree that it is
yuck and should be fixed.  However, the readers should be fixed
also.  Something like XModem will pad bytes to the end and readers
should be able to handle this too.            -- Darren