Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Krita
Commits
e1d030ca
Commit
e1d030ca
authored
Oct 03, 2022
by
Amy spark
👉
Browse files
TIFF: support sub IFD offsets
BUG: 459840
(cherry picked from commit
96ee473d
)
parent
40f3f450
Pipeline
#241302
passed with stage
in 67 minutes and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
plugins/impex/tiff/kis_tiff_import.cc
View file @
e1d030ca
...
...
@@ -52,6 +52,8 @@
struct
KisTiffBasicInfo
{
uint32_t
width
{};
uint32_t
height
{};
float
x
{};
float
y
{};
float
xres
{};
float
yres
{};
uint16_t
depth
{};
...
...
@@ -1406,6 +1408,9 @@ KisTIFFImport::readImageFromTiff(KisDocument *m_doc,
m_image
->
addNode
(
KisNodeSP
(
layer
),
m_image
->
rootLayer
().
data
());
layer
->
paintDevice
()
->
setX
(
static_cast
<
int
>
(
basicInfo
.
x
*
basicInfo
.
xres
));
layer
->
paintDevice
()
->
setY
(
static_cast
<
int
>
(
basicInfo
.
y
*
basicInfo
.
yres
));
// Process rotation before handing image over
// https://developer.apple.com/documentation/imageio/cgimagepropertyorientation
switch
(
orientation
)
{
...
...
@@ -1502,6 +1507,16 @@ KisImportExportErrorCode KisTIFFImport::readTIFFDirectory(KisDocument *m_doc,
basicInfo
.
yres
=
100
;
}
if
(
TIFFGetField
(
image
,
TIFFTAG_XPOSITION
,
&
basicInfo
.
x
)
==
0
)
{
dbgFile
<<
"Image does not define a horizontal offset"
;
basicInfo
.
x
=
0
;
}
if
(
TIFFGetField
(
image
,
TIFFTAG_YPOSITION
,
&
basicInfo
.
y
)
==
0
)
{
dbgFile
<<
"Image does not define a vertical offset"
;
basicInfo
.
y
=
0
;
}
if
((
TIFFGetField
(
image
,
TIFFTAG_BITSPERSAMPLE
,
&
basicInfo
.
depth
)
==
0
))
{
dbgFile
<<
"Image does not define its depth"
;
basicInfo
.
depth
=
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment