[Bug 269846] New: TIFF loader is broken on big-endian architectures [PATCH]

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 269846] New: TIFF loader is broken on big-endian architectures [PATCH]

pochini
https://bugs.kde.org/show_bug.cgi?id=269846

           Summary: TIFF loader is broken on big-endian architectures
                    [PATCH]
           Product: digikam
           Version: 2.0.0
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]


Created an attachment (id=58481)
 --> (http://bugs.kde.org/attachment.cgi?id=58481)
Fix TIFF loader on big-endian architectures

Version:           2.0.0 (using KDE 4.5.2)
OS:                Linux

In the TIFF loader all those if-QSysInfo::ByteOrder in the 16 bits color path
are wrong because the order of color components is always the same for any
architecture. I removed all of them and I left the "else" code paths only.

NOTE: I was able to test only the 3-samples-per-pixel PLANARCONFIG_CONTIG part
of the code because I haven't images in other formats.

The 8 bits image loader is fine.

The saver is also buggy, but the bugs cancel each other when !imageHasAlpha().
There are also other issues I will investigate (and try to fix) later.
The attached patch fixes the loader only. I wrote and tested it for 1.8.0 and
forward ported it to the latest GIT version.

Reproducible: Always

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 269846] TIFF loader is broken on big-endian architectures [PATCH]

Gilles Caulier-4
https://bugs.kde.org/show_bug.cgi?id=269846


Gilles Caulier <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]




--- Comment #1 from Gilles Caulier <caulier gilles gmail com>  2011-04-01 11:31:10 ---
Thanks a lots for your patch.

Please take a look in my reprository, where a lots of different tiff files are
available to test :

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

I'm waiting your future improved patch...

Gilles Caulier

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 269846] TIFF loader is broken on big-endian architectures [PATCH]

Gilles Caulier-4
In reply to this post by pochini
https://bugs.kde.org/show_bug.cgi?id=269846





--- Comment #2 from Gilles Caulier <caulier gilles gmail com>  2011-12-12 20:19:42 ---
Pochini,

Do you see my Comment #1 ?

Gilles Caulier

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 269846] TIFF loader is broken on big-endian architectures [PATCH]

pochini
In reply to this post by pochini
https://bugs.kde.org/show_bug.cgi?id=269846





--- Comment #3 from  <pochini shiny it>  2011-12-13 21:38:52 ---
No, the message was buried in the mess of my mailbox.
However I continued development. I got stuck with a problem when saving images.
In some cases the saved image is corrupted. I know how to reproduce it, but I
wasn't able to figure out why it happens. I also tried to debug libtiff without
luck. I'll try again...

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 269846] TIFF loader is broken on big-endian architectures [PATCH]

Marcel Wiesweg
In reply to this post by pochini
https://bugs.kde.org/show_bug.cgi?id=269846

Marcel Wiesweg <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
   Version Fixed In|                            |3.0
         Resolution|---                         |FIXED
      Latest Commit|                            |http://commits.kde.org/digi
                   |                            |kam/b27eae029207187882ae094
                   |                            |e94158abfd903d379

--- Comment #4 from Marcel Wiesweg <[hidden email]> ---
Git commit b27eae029207187882ae094e94158abfd903d379 by Marcel Wiesweg.
Committed on 29/09/2012 at 15:07.
Pushed by mwiesweg into branch 'master'.

Apply patch by [hidden email] to fix TIFF loading on big endian, and attempt
to fix saving as well
by using ushort instead of messing with single bytes. Untested due to lack of
hardware to test.
FIXED-IN: 3.0

M  +59   -148  libs/dimg/loaders/tiffloader.cpp

http://commits.kde.org/digikam/b27eae029207187882ae094e94158abfd903d379

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 269846] TIFF loader is broken on big-endian architectures [PATCH]

bugzilla_noreply
In reply to this post by pochini
https://bugs.kde.org/show_bug.cgi?id=269846

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|general                     |ImageEditor-FileIO

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 269846] TIFF loader is broken on big-endian architectures [PATCH]

bugzilla_noreply
In reply to this post by pochini
https://bugs.kde.org/show_bug.cgi?id=269846

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|FilesIO-Engine              |FilesIO-TIFF

--
You are receiving this mail because:
You are the assignee for the bug.