red & blue color channels swapped

Hi. When compiling, my color channels appear as BGR instead of RGB. Anybody knows how to fix this issue?

I tried the following solutions found on this forum, but without luck:

In ofImage::loadImageIntoPixels, I changed from:
Code:
#if ( TARGET_LITTLE_ENDIAN )
if (byteCount != 1) swapRgb(pix);
#endif
to:
Code:
#if ( TARGET_LITTLE_ENDIAN ) || ( TARGET_OS_IPHONE )
if (byteCount != 1) swapRgb(pix);
#endif

In saveImageIntoPixels, change to:
Code:
#if ( TARGET_LITTLE_ENDIAN ) || ( TARGET_OS_IPHONE )
if (pix.bytesPerPixel != 1) swapRgb(pix);
#endif
FIBITMAP * bmp = getBmpFromPixels(pix);
#if ( TARGET_LITTLE_ENDIAN ) || ( TARGET_OS_IPHONE )
if (pix.bytesPerPixel != 1) swapRgb(pix);
#endif

I also tried the following in ofConstants.h, line 93:

Code:
#if defined(__LITTLE_ENDIAN__)
#define TARGET_LITTLE_ENDIAN // intel cpu
#endif
with
Code:
//#if defined(__LITTLE_ENDIAN__)
#define TARGET_LITTLE_ENDIAN // intel cpu
//#endif

or if that doesn’t work:

Code:
//#if defined(__LITTLE_ENDIAN__)
// #define TARGET_LITTLE_ENDIAN // intel cpu
//#endif

Im on OF v0061 and iOS 4.2. The color problem occours both on live vidio stream and my textures. Any suggestions are appreciated!!

Thanks:)

Did you compile freeimage as described here http://forum.openframeworks.cc/t/xcode-3.2.3-±iphone-sdk-4-beta-works-with-ofxiphone/3658/12">http://forum.openframeworks.cc/t/xcode-3.2.3-+-iphone-sdk-4-beta-works-with-ofxiphone/3658/12]http://forum.openframeworks.cc/t/xcode-3.2.3-±iphone-sdk-4-beta-works-with-ofxiphone/3658/12?

You might need to undo those code changes you made as well.