Page 1 of 1

PNG Loading

Posted: Fri Jun 03, 2011 10:27
by wondersye
Hello,

Just suggesting to document a bit more that, AFAIK:

- you need a specific image codec to run Samples (ex: Demo6); otherwise we have:

Code: Select all

03/06/2011 11:35:40 (Std)     Attempting to create Imageset 'cegui_logo' using image file 'logo.png'.
03/06/2011 11:35:40 (Error)    CEGUI::RendererException in file CEGUIOpenGLTexture.cpp(139) : OpenGLTexture::loadFromFile - TGAImageCodec - Official TGA image codec failed to load image 'logo.png'.
(indeed we should not expect the TGA codec to read PNG, however the error message could be clearer, ex: "failed to load image 'logo.png' PNG format not supported by TGA codec; one must enable PNG codec support at CEGUI's configuration-time" or alike)

- apparently FreeImage is to be preferred to DevIL to be preferred to SILLY?

- I was wondering whether SDL_image is/could be supported as well?

- I had to install GLUT for the Samples (

Code: Select all

apt-get install libglut3-dev libglut3
), got bitten by this

Finally, I will later investigate to know whether images can be read from buffers/"abstract I/O streams", when direct loading from a filesystem is not possible (ex: when using abstract filesystems like PhysicsFS).

Thanks for this very useful library,
Best regards,

Olivier Boudeville.

PS: minor hint to enable the use of a prefixed install of freetype:

Code: Select all

   export freetype2_CFLAGS="-I${freetype_PREFIX}/include -I${freetype_PREFIX}/include/freetype2"
   export freetype2_LIBS="-L${freetype_PREFIX}/lib -lfreetype"

(before configuration)

Re: PNG Loading

Posted: Fri Jun 03, 2011 14:14
by Kulik
Yeah I agree this isn't completely idiot proofed :wink:

Having a special warning about this would require us to implement a special case in the code to handle this. This is not something I like the sound of. Especially since you can provide your own ImageCodec and use it with the stock CEGUI samples.
Maybe blacklisting the TGA codec would help, that said IIRC we planned to even strip TGAImageCodec from 0.8 altogether to lessen maintenance pain (nobody is using just TGA now anyways).

I myself use FreeImage but it is kind of hated in the Linux community (they don't use system libraries and instead pack their own, Windows application style). It works great though. It's really up to you what you will use. The greatest strength of the whole abstraction is that you can use Ogre image loading facilities directly in CEGUI for example.

Re: PNG Loading

Posted: Sat Jun 04, 2011 10:23
by wondersye
Hi Kulik,

Thanks for your answer. I am opting to use FreeImage, however I just see that apparently there is no way of specifying where a FreeImage install should be found?

I have to install it in a non-system (prefixed) directory, and saw that there are *_CFLAGS and *_LIBS for a lot of prerequisites...but not for FreeImage ? Could it be added?

Best regards,

Olivier Boudeville.

Re: PNG Loading

Posted: Sun Jun 05, 2011 10:34
by Kulik
It definitely could be added, thanks for the problem spotting. However as I said we have already migrated to an entirely different cmake build system in 0.8 and we are not sure whether we will even release 0.7.6 SDK (there are some fixes so it might be worth it though).

I guess unless you intend to get your hands dirty and patch this, this might not happen, depending on whether I or CE get spare time to do this. Maybe add this to the mantis tracker so it doesn't get forgotten.

Re: PNG Loading

Posted: Sun Jun 05, 2011 11:06
by wondersye
Thank you again. As indeed it is probably not of paramount priority, I think I will send a bug report and/or a patch iff the newer 0.8 build will not allow it.

Best regards,

Olivier.