Hi Thomas,
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!
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?
quite strange the osb loader/writer uses the image store/restore methods
(for png and jpeg) and it works fine. For an example how to use it look
in OpenSG/Source/Experimental/NativeFileIO/OSGNFIOImage.cpp
Andreas
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).
Thanks for any hints!
Thomas
-------------------------------------------------------
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
-------------------------------------------------------
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