Hi Thomas,
On Wed, 2005-11-02 at 16:11 +0100, Thomas Beer wrote:
> Hi,
>
> I'm trying to load textures from a Qt resource file. Therefore I load
> the file into a QByteArray and pass this to the restoreData-Method of
> the appropriate ImageFileType.
> Grepping the headers restoreData should be implemented for DAT, JPG, MTD
> and PNG. However only the PNG-Implementation seems to work (haven't
> tried DAT):
>
> MTD: restoreData returns 0, gives no further errors and results in a
> black (empty) texture if I use that image.
> PNG: restoreData returns 772865 while buffer/filesize was 772881 but
> image seems to load ok (no visible errors).
> JPG: does not return, program aborts with the following message:
>
> Corrupt JPEG data: 1420 extraneous bytes before marker 0xd8
> Invalid JPEG file structure: two SOI markers
>
> I also tried loading with STL-streams (with code copied from
> testImageMem), fopen/fread and Win32 native file reading instead of the
> Qt-Resources but it makes no difference!
That's weird, they used to work quite well, but I haven't tried that in
a while.
> As a workaround I could use the Qt-Image class to load the textures so
> far, but I'm wondering whether the restoreData-Implementations are buggy?
They shouldn't be. Could you write a Tutorial-style example that let's
us reproduce it?
> Another one: I also want to load a TTF from memory/resources. Is there a
> way to do it or do I have to derive and implement my own font loading
> (AFAIR it's just a FT_New_Memory_face(buf) instead of FT_New_face
> (file) with freetype).
I can't answer that one. Patrick?
Dirk
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users