TGA support for KDE

Malte Starostik malte at kde.org
Mon Jan 27 02:01:48 GMT 2003


On Sunday 26 January 2003 22:37, Dominik Seichter wrote:
> Am Sonntag, 26. Januar 2003 15:37 schrieb Malte Starostik:
> > On Sunday 26 January 2003 14:38, Waldo Bastian wrote:
> > > Your .kimgio file should define a Header entry that can be used to
> > > identify a TGA file. This header entry is a regexp, see
> > > qimageio.html#defineIOHandler for details. Non-ascii chars should be
> > > encoded like this:
> > >
> > > 	Header=^\x01\x01\x01\x0C\x6A\x50
> >
> > FWIW, and make sure that if you have to match a 0-byte to use \x01
> > instead as Qt uses this to distinguish it from the string terminator.
>
> Thanks for the tip, it works now for RLE compressed tga files, but
> uncompressed files are still not recogniced.
>
> RLE compressed TGA files start with 0x00 0x00 0x0a and I use the following
> header to match them: ^\x01\x01\x0a
> Uncommpressed TGA images start with 0x00 0x00 0x02, but I can't match them
> using the header ^\x01\x01\x02 . What is wrong with this reg expression?

Do you have a current version of kdelibs/kimgio/ico.kimgio?
I recently changed the Header regex for .ico/.cur files from \001\001 to 
\001\001[\001|\002]\001 so if you still have the old version, it might match 
on TGA. Grr, doesn't it suck that both TGA and ICO/CUR have no real "magic" 
header? A .cur (Windows cursor, essentially the same as .ico) file starts 
with 0x00 0x00 0x02 0x00, so any TGA with that start will still be considered 
a CUR file if the ico/cur reader is registered first and all .cur files will 
be treated like a TGA if that reader is registered first.

-Malte




More information about the kde-core-devel mailing list