Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
db7f6897
Commit
db7f6897
authored
5 years ago
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imgcodecs(tiff): add more checks
backporting of commit:
f6230ae0
parent
b3e6c97d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
grfmt_tiff.cpp
modules/imgcodecs/src/grfmt_tiff.cpp
+7
-3
No files found.
modules/imgcodecs/src/grfmt_tiff.cpp
View file @
db7f6897
...
...
@@ -537,6 +537,7 @@ bool TiffDecoder::readData( Mat& img )
}
else
{
CV_CheckEQ
(
wanted_channels
,
3
,
"TIFF-8bpp: BGR/BGRA images are supported only"
);
icvCvt_BGRA2BGR_8u_C4C3R
(
bstart
+
i
*
tile_width0
*
4
,
0
,
img
.
ptr
(
img_y
+
tile_height
-
i
-
1
,
x
),
0
,
Size
(
tile_width
,
1
),
2
);
...
...
@@ -544,6 +545,7 @@ bool TiffDecoder::readData( Mat& img )
}
else
{
CV_CheckEQ
(
wanted_channels
,
1
,
""
);
icvCvt_BGRA2Gray_8u_C4C1R
(
bstart
+
i
*
tile_width0
*
4
,
0
,
img
.
ptr
(
img_y
+
tile_height
-
i
-
1
,
x
),
0
,
Size
(
tile_width
,
1
),
2
);
...
...
@@ -569,12 +571,14 @@ bool TiffDecoder::readData( Mat& img )
{
if
(
ncn
==
1
)
{
CV_CheckEQ
(
wanted_channels
,
3
,
""
);
icvCvt_Gray2BGR_16u_C1C3R
(
buffer16
+
i
*
tile_width0
*
ncn
,
0
,
img
.
ptr
<
ushort
>
(
img_y
+
i
,
x
),
0
,
Size
(
tile_width
,
1
));
}
else
if
(
ncn
==
3
)
{
CV_CheckEQ
(
wanted_channels
,
3
,
""
);
icvCvt_RGB2BGR_16u_C3R
(
buffer16
+
i
*
tile_width0
*
ncn
,
0
,
img
.
ptr
<
ushort
>
(
img_y
+
i
,
x
),
0
,
Size
(
tile_width
,
1
));
...
...
@@ -589,6 +593,7 @@ bool TiffDecoder::readData( Mat& img )
}
else
{
CV_CheckEQ
(
wanted_channels
,
3
,
"TIFF-16bpp: BGR/BGRA images are supported only"
);
icvCvt_BGRA2BGR_16u_C4C3R
(
buffer16
+
i
*
tile_width0
*
ncn
,
0
,
img
.
ptr
<
ushort
>
(
img_y
+
i
,
x
),
0
,
Size
(
tile_width
,
1
),
2
);
...
...
@@ -596,13 +601,12 @@ bool TiffDecoder::readData( Mat& img )
}
else
{
icvCvt_BGRA2BGR_16u_C4C3R
(
buffer16
+
i
*
tile_width0
*
ncn
,
0
,
img
.
ptr
<
ushort
>
(
img_y
+
i
,
x
),
0
,
Size
(
tile_width
,
1
),
2
);
CV_Error
(
Error
::
StsError
,
"Not supported"
);
}
}
else
{
CV_CheckEQ
(
wanted_channels
,
1
,
""
);
if
(
ncn
==
1
)
{
memcpy
(
img
.
ptr
<
ushort
>
(
img_y
+
i
,
x
),
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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