I get an error when I run encode.c with a true color TGA. Somehow TGAWriteImage calls TGAWriteColorMap which calls TGAWrite(tga, buf, n, 1) with n=0 which returns 0 which is considered an error. I'm using libtga-1.0.1.
Apparently the problem is in TGAReadImage. It is not setting data->cmap to NULL If the TGA is not color-mapped. Also TGAWriteImage checks for data->cmap, not TGA_IS_MAPPED.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey,
I forked this project on GitHub and fixed some bugs on the way.
My fork can run length encode (and decode) the attached file just fine.
The fork is at https://github.com/madebr/libtga.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Image that encode.c doesn't handle.
Logged In: YES
user_id=778134
Originator: YES
Apparently the problem is in TGAReadImage. It is not setting data->cmap to NULL If the TGA is not color-mapped. Also TGAWriteImage checks for data->cmap, not TGA_IS_MAPPED.
Hey,
I forked this project on GitHub and fixed some bugs on the way.
My fork can run length encode (and decode) the attached file just fine.
The fork is at https://github.com/madebr/libtga.