[Gimp-developer] errors in the TGA plugin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
I think that I found some mistakes in the code that reads and writes
RLE-compressed TGA files (in tga.c). Gimp can generate a RLE-compressed 
file containing RLE packets, which go through the end of a scan line
(that is encode pixels from more that one pixel line), which is 
prohibited by the standard.

I tested it by generating a 5x5 grayscale image with the following 
pattern:

OXXOO
OXXOO
OXXOO
OXXOO
OOOOO
(O = white, X = black)

Gimp compressed the white pixels with one packet containing the first pixel,
3 packets containing the last two pixels on i-th line a the first
pixel on (i-1)-th line (i=1,2,3), and one packet containing the last 7 pixels.
I think that the reason is in setting the width variable in save_image():
here the width should be equal to the width of the image.

Another problem is in the rle_read() function: variables repeat and direct
are not correctly initialized on every call of rle_read(), as they are
static. This is, by a chance (IMO) the reason, why Gimp can read its
own RLE-compressed files: these two variables keep their values from the
last call.

I apologize that I can't try to fix the errors myself at the moment, as I'm
late with some urgent SW project.

Best regards,

Petr 

-- 
Petr Mejzlik
Dept. of Information Technology, Faculty of Informatics      
Masaryk University                            Internet: mejzlik@xxxxxxxxxx
Botanicka 68a                                 FAX : +42-05-4121 2568
CZ-602 00 Brno, Czech Republic                Tel.: +42-05-4151 2338


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux