Bug 148037 - tiff images are not displayed with correct colours - endian issue on powerpc?
Summary: tiff images are not displayed with correct colours - endian issue on powerpc?
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-TIFF (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-19 22:25 UTC by Mark Purcell
Modified: 2022-01-31 12:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.3


Attachments
The TIFF images come out very RED.. :-( (256.84 KB, image/png)
2007-07-19 22:28 UTC, Mark Purcell
Details
Solar_Spectrum.tiff as Thumbnail with digikam-0.9.2-3_powerpc (Debian etch) (111.07 KB, image/png)
2007-08-11 23:48 UTC, Fabrice Flore-Thebault
Details
Solar_Spectrum.tiff in the Preview with digikam-0.9.2-3_powerpc (Debian etch) (478.73 KB, image/png)
2007-08-11 23:49 UTC, Fabrice Flore-Thebault
Details
Solar_Spectrum.tiff in the Editor with digikam-0.9.2-3_powerpc (Debian etch) (410.90 KB, image/png)
2007-08-11 23:50 UTC, Fabrice Flore-Thebault
Details
Change byte order in 8-bit tiff loader (591 bytes, patch)
2007-08-12 16:47 UTC, Marcel Wiesweg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Purcell 2007-07-19 22:25:44 UTC
Version:           0.9.2-beta3 (using KDE 3.5.5, Debian Package 4:3.5.5a.dfsg.1-8 (4.0))
Compiler:          Target: powerpc-linux-gnu
OS:                Linux (ppc) release 2.6.18-4-powerpc

It would appear that there is an endian issue with the display of tiff images under powerpc.

I can confirm the report of
 http://bugs.debian.org/351931 on my iBook (powerpc).

With both 0.9.2~beta and 0.9.2 final.

Mark
Comment 1 Mark Purcell 2007-07-19 22:28:05 UTC
Created attachment 21196 [details]
The TIFF images come out very RED.. :-(

This screenshot shows a album with some jpeg and tiff images, note the 
colour shift for the tiff images.  Same applies on viewing images full screen

Mark
Comment 2 Mark Purcell 2007-07-19 22:30:45 UTC
Sorry the initial report should read:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=432503
Comment 3 Philip Rodrigues 2007-07-20 21:24:36 UTC
Does the same problem occur in any other image viewing/manipulation apps? (Perhaps it's a problem in a lower level library)
Comment 4 Mark Purcell 2007-07-28 12:57:59 UTC
The TIF files display fine in konqueror, kuickshow, showimg.

In digikam they have the tint has shown in the attachments,  in showfoto, only the thumbnails have the wrong tint, the large image is displayed correctly.

Could be an endian problem like: http://bugs.kde.org/show_bug.cgi?id=121646

Mark
Comment 5 Marcel Wiesweg 2007-07-30 19:17:49 UTC
I have uploaded an image of the spectrum here:

http://digikam3rdparty.free.fr/TEST_IMAGES/TIFF/Solar_Spectrum.tiff

If you could post a screenshot how this image looks on your computer a) as thumbnail b) in the preview c) in the editor.
If the file looks correct, we will have to test with 16bit images.

The problem with endian bugs is that we can never test possible solutions...
Comment 6 Fabrice Flore-Thebault 2007-08-11 23:48:29 UTC
Created attachment 21372 [details]
Solar_Spectrum.tiff as Thumbnail with digikam-0.9.2-3_powerpc (Debian etch)
Comment 7 Fabrice Flore-Thebault 2007-08-11 23:49:39 UTC
Created attachment 21373 [details]
Solar_Spectrum.tiff in the Preview with digikam-0.9.2-3_powerpc (Debian etch)
Comment 8 Fabrice Flore-Thebault 2007-08-11 23:50:43 UTC
Created attachment 21374 [details]
Solar_Spectrum.tiff in the Editor with digikam-0.9.2-3_powerpc (Debian etch)
Comment 9 Fabrice Flore-Thebault 2007-08-12 00:55:41 UTC
Always about displaying weird colors : it does not only happens when editing TIFF files, but when saving RAW files as PNG files in the Editor too.

Here is what happens with a PNG file saved from a RAW (DNG) file processed in the Digikam Editor : The Thumbnail and Preview display this PNG file nicely (sky is blue) ; but the Editor and other viewers (Konqueror on the same iBook, a file viewer on an i386 machine) display the picture strangely (sky is orange). Saving the same DNG file as JPG or TIFF is OK. If I reopen the weird PNG file in the Editor, it is displayed with wrong colors, but if I save it again as PNG, with no changes, the the new PNG file is a good one. Strange isn't it ?

Hope it is not to confusing and helps a little.

PS1 : Tests done with digikam-0.9.2-3_powerpc digikam-0.9.2-4_powerpc on Debian etch

PS2 : The PNG file I could send is a too big file, but when I reduce the picture there are no more color problems to show, so there is no attachment.
Comment 10 Marcel Wiesweg 2007-08-12 16:47:05 UTC
Created attachment 21377 [details]
Change byte order in 8-bit tiff loader

Thanks for the screenshots. When checking R,G,B and black (0,0,0,255) it is
clear that the problem is RGBA -> ABGR.
This can easily be changed in the TIFF loader code, see attached patch.

As to the other problem, there may well be some other part of code that is not
endian proof. There seem to be not to many users of digikam on affected
systems. If test how a file looks when it is opened again, always close digikam
in between to clear the cache.
Comment 11 caulier.gilles 2007-11-28 13:12:32 UTC
Somebody can test the patch fromMarcel on PPC computer ?

Thanks in advance

Gilles Caulier
Comment 12 Mark Purcell 2007-11-28 21:17:21 UTC
Yes i can confirm this resolves the issue for powerpc.

Mark

-original message-
Subject: [Bug 148037] tiff images are not displayed with correct colours - endian issue on powerpc?   
From: Gilles Caulier <caulier.gilles@gmail.com>
Date: 28/11/2007 12:12

------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.
         
http://bugs.kde.org/show_bug.cgi?id=148037         
caulier.gilles gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|general                     |Portability



------- Additional Comments From caulier.gilles gmail com  2007-11-28 13:12 -------
Somebody can test the patch fromMarcel on PPC computer ?

Thanks in advance

Gilles Caulier
Comment 13 caulier.gilles 2007-11-28 21:37:39 UTC
Thanks Mark. I wil fix it into svn 

Gilles
Comment 14 caulier.gilles 2007-11-28 21:42:07 UTC
Mark,

The patch from Marcel only fix the loading of TIFF file in 8 bits color depth. Can you test if you have the same problem with a 16 bits image ?

Gilles
Comment 15 caulier.gilles 2007-11-28 22:02:18 UTC
SVN commit 742750 by cgilles:

fix byte order problem with tiff image under PPC
CCBUGS: 148037


 M  +46 -13    tiffloader.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=742750
Comment 16 caulier.gilles 2007-11-28 22:08:52 UTC
SVN commit 742755 by cgilles:

backport commits #742750 from KDE3 branch
BUG: 148037


 M  +45 -13    tiffloader.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=742755
Comment 17 caulier.gilles 2007-11-28 22:11:51 UTC
Mark,

TIFF loader with 8 and 16 bits color depth is fixed in svn. Let's me hear if all is fine for you.

Gilles