Red Stuff in ofIMage Appearing Blue - Fixed?

Running Ubuntu 7.10 on a Thinkpad t61, OF 0.04, the Makefile version.

I had the problem where any image I displayed with ofImage::draw appeared to have the red and the blue swapped. I did a search on the forums and found this:

http://openframeworks.cc/forum/viewtopi-…-light=blue

After reading this I did a search for endian in some of the openframeworks header files and found these lines in ofConstants.h under #ifdef TARGET_LINUX:

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

I’m not sure where __LITTLE_ENDIAN__ comes from, but I commented out the #if #endif lines, forcing the header file to #define TARGET_LITTLE_ENDIAN and it worked! My images appear fine now.

This is a rather lucky hack because I’m not sure what I’m doing. Can anyone explain what’s going on?

Thanks,
Brian

strange - it’s a #define that should be getting activated. I will need to experiment with ubuntu and see what’s happening but have noticed this once or twice before.

also, it could be that I am doing something wrong in the makefile. thanks for pointing out the change, and I will look for a solution in the meantime.

thanks!!
zach

Nice spotting Brian,
I just noticed that recently as well…suspected bgr <-> rgb but forgot to flag it.
I’m also using OF 0.04 Makefile version.