Bug 215752 - Endianness bug saving 16 bits images [patch]
Summary: Endianness bug saving 16 bits images [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: DImg-Core (show other bugs)
Version: 1.0.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-22 22:39 UTC by pochini
Modified: 2017-07-31 15:55 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.0.0
Sentry Crash Report:


Attachments
Fix 16 bits PNG output on big-endian architectures. (875 bytes, text/plain)
2009-11-26 00:45 UTC, pochini
Details
16 bits PNG loader fix (571 bytes, patch)
2009-12-20 22:22 UTC, pochini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pochini 2009-11-22 22:39:28 UTC
Version:           1.0.0-beta6 (using KDE 4.3.3)
Compiler:          gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.2)  powerpc
OS:                Linux
Installed from:    Compiled From Sources

On big-endian archs digikam does not save 16 bits images properly. Saving completes without errors, but when the image is loaded with any other program it looks scrabled.
Comment 1 pochini 2009-11-26 00:45:28 UTC
Created attachment 38590 [details]
Fix 16 bits PNG output on big-endian architectures.

The attached patch fixes the bug I reported. It doesn't affect little-endian machines.
Comment 2 Marcel Wiesweg 2009-12-20 16:25:20 UTC
pochini, do you have an explanation why the loop after loading in pngloader.cpp, 449-461, works on big endian? Isn't it swapping from network byte order to little endian?
Comment 3 Marcel Wiesweg 2009-12-20 16:31:59 UTC
SVN commit 1064297 by mwiesweg:

Fix PNG saving on big endian,
patch from  pochini@shiny.it

BUG: 215752

 M  +2 -1      NEWS  
 M  +44 -31    libs/dimg/loaders/pngloader.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1064297
Comment 4 pochini 2009-12-20 22:22:07 UTC
Created attachment 39198 [details]
16 bits PNG loader fix
Comment 5 pochini 2009-12-20 22:25:10 UTC
(In reply to comment #2)
> pochini, do you have an explanation why the loop after loading in
> pngloader.cpp, 449-461, works on big endian? Isn't it swapping from network
> byte order to little endian?

Yes... it doesn't work. Sorry, I didn't test 16 bits PNG loading. I've just uploaded a patch that fixes it too.
Comment 6 Marcel Wiesweg 2009-12-21 20:39:41 UTC
SVN commit 1064788 by mwiesweg:

Fix 16bit PNG loading on Big Endian,
thanks to pochini@shiny.it

CCBUG: 215752

 M  +17 -14    pngloader.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1064788