Bug 423389 - Problem loading TIFF file, negative numbers are at the top end of the range when int16 is interpreted as uint16
Summary: Problem loading TIFF file, negative numbers are at the top end of the range w...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 4.3.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-23 08:53 UTC by Tobias
Modified: 2021-06-29 06:03 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias 2020-06-23 08:53:55 UTC
The the Blue Earth Bathymetry image (public domain) from http://www.shadedrelief.com/blue-earth/ doesn't load right.
This is how it should look like:
https://gitlab.gnome.org/GNOME/gimp/uploads/a2e4e7ca483354877c4a8b1cf9f84ecf/image.png

This is how it looks in Krita 4.3.0 (I used the GIMP screenshot, but it looks the same in Krita):
https://gitlab.gnome.org/GNOME/gimp/uploads/43578396382c5471b4e4bf1f4382f0a8/image.png

Miha Kadunc on Twitter wrote:
"This happens because negative numbers are at the top end of the range when int16 is interpreted as uint16"
https://twitter.com/miha_kadunc/status/1275091809493008385
Direct download:
http://www.shadedrelief.com/blue-earth/Blue-Earth-Bathymetry.zip
Comment 1 Tiar 2020-07-27 23:49:33 UTC
Yeah. Krita reads and knows it's int, but then ignores it completely.

Btw is there any place to get this file but cropped/much smaller? It eats lots of RAM and time to open it, and of course cropping in Krita or Gimp (since I have an older version) or Darktable destroys the uniqueness of the file, since it's converted from ints to uints.
Comment 2 Bug Janitor Service 2021-06-26 19:55:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/929
Comment 3 Dmitry Kazakov 2021-06-29 06:03:26 UTC
Git commit 1df75d54ff3b95218fb4cff324a7412b544abf9c by Dmitry Kazakov, on behalf of L. E. Segovia.
Committed on 29/06/2021 at 06:03.
Pushed by dkazakov into branch 'master'.

TIFF: support signed integer formats

M  +4    -0    plugins/impex/tiff/kis_tiff_converter.cc
M  +31   -4    plugins/impex/tiff/kis_tiff_reader.h

https://invent.kde.org/graphics/krita/commit/1df75d54ff3b95218fb4cff324a7412b544abf9c