Share

FreeImage

Tracker: Bugs

5 Red/Blue channels swapped - ID: 2769204
Last Update: Comment added ( sf-robot )

Ogre3D is seeing an issue with FreeImage swapping the red and blue
channels.
This problem was apparently introduced in 3.10 (3.9.3 worked), and persists
through 3.12.
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=49326


Ethan Tira-Thompson ( ejtttje ) - 2009-04-16 18:38

5

Closed

Fixed

Hervé Drolon

None

None

Public


Comments ( 6 )

Date: 2009-05-05 02:22
Sender: sf-robotSourceForge.net Site Admin

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).


Date: 2009-04-20 19:59
Sender: drolonProject AdminAccepting Donations

see
https://sourceforge.net/forum/forum.php?thread_id=1775970&forum_id=36111



Date: 2009-04-20 19:21
Sender: ejtttje

Might want to ask ark42 why he introduced FREEIMAGE_COLORORDER in the first
place... seems equivalent to FREEIMAGE_BIGENDIAN... just wanted a more
descriptive name for what was being tested?



Date: 2009-04-20 18:21
Sender: drolonProject AdminAccepting Donations

I've fixed the FreeImage.h header file in the CVS by removing the __APPLE__
#define




Date: 2009-04-20 17:35
Sender: ejtttje

Ah, thanks for tracking that down.

I don't think you should be testing __APPLE__ at all as an indication of
byte order. Intel macs are little endian, PowerPC macs are big endian.

So for instance, I tested that this gives an accurate report:
#include <FreeImage.h>
#include <stdio.h>

int main(int argc, char** argv) {
#if defined(FREEIMAGE_BIGENDIAN)
printf("big-end detected\n");
#else
printf("little-end detected\n");
#endif
return 0;
}

but if you add the '|| defined(__APPLE__)' it always picks big-end
regardless of the actual host architecture...


Date: 2009-04-20 17:01
Sender: drolonProject AdminAccepting Donations

Hi,

your problem is linked to the FreeImage.h header file and the following
#define :

// This really only affects 24 and 32 bit formats, the rest are always RGB
order.
#define FREEIMAGE_COLORORDER_BGR 0
#define FREEIMAGE_COLORORDER_RGB 1
#if defined(__APPLE__) || defined(FREEIMAGE_BIGENDIAN)
#define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_RGB
#else
#define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_BGR
#endif

I don't know how to check that you run an APPLE with a Little Endian
processor ...
Can you try this :
#if defined(__APPLE__) && defined(FREEIMAGE_BIGENDIAN)
and tell me if it works for you ?





Attached File

No Files Currently Attached

Changes ( 11 )

Field Old Value Date By
allow_comments 1 2009-05-05 02:22 sf-robot
status_id Pending 2009-05-05 02:22 sf-robot
close_date 2009-04-20 19:59 2009-05-05 02:22 sf-robot
close_date - 2009-04-20 19:59 drolon
status_id Open 2009-04-20 19:59 drolon
close_date 2009-04-20 18:21 2009-04-20 19:21 ejtttje
status_id Pending 2009-04-20 19:21 ejtttje
status_id Open 2009-04-20 18:21 drolon
close_date - 2009-04-20 18:21 drolon
assigned_to nobody 2009-04-20 18:21 drolon
resolution_id None 2009-04-20 18:21 drolon