Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
90ab9a58
Commit
90ab9a58
authored
Jan 12, 2019
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/tiff: Support CMYK images.
Fixes ticket #3459.
parent
261e4cf0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
tiff.c
libavcodec/tiff.c
+20
-2
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/tiff.c
View file @
90ab9a58
...
...
@@ -825,7 +825,7 @@ static int init_image(TiffContext *s, ThreadFrame *frame)
s
->
avctx
->
pix_fmt
=
s
->
le
?
AV_PIX_FMT_YA16LE
:
AV_PIX_FMT_YA16BE
;
break
;
case
324
:
s
->
avctx
->
pix_fmt
=
AV_PIX_FMT_RGBA
;
s
->
avctx
->
pix_fmt
=
s
->
photometric
==
TIFF_PHOTOMETRIC_SEPARATED
?
AV_PIX_FMT_RGB0
:
AV_PIX_FMT_RGBA
;
break
;
case
483
:
s
->
avctx
->
pix_fmt
=
s
->
le
?
AV_PIX_FMT_RGB48LE
:
AV_PIX_FMT_RGB48BE
;
...
...
@@ -1100,12 +1100,12 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
case
TIFF_PHOTOMETRIC_BLACK_IS_ZERO
:
case
TIFF_PHOTOMETRIC_RGB
:
case
TIFF_PHOTOMETRIC_PALETTE
:
case
TIFF_PHOTOMETRIC_SEPARATED
:
case
TIFF_PHOTOMETRIC_YCBCR
:
case
TIFF_PHOTOMETRIC_CFA
:
s
->
photometric
=
value
;
break
;
case
TIFF_PHOTOMETRIC_ALPHA_MASK
:
case
TIFF_PHOTOMETRIC_SEPARATED
:
case
TIFF_PHOTOMETRIC_CIE_LAB
:
case
TIFF_PHOTOMETRIC_ICC_LAB
:
case
TIFF_PHOTOMETRIC_ITU_LAB
:
...
...
@@ -1530,6 +1530,24 @@ again:
dst
+=
stride
;
}
}
if
(
s
->
photometric
==
TIFF_PHOTOMETRIC_SEPARATED
&&
s
->
avctx
->
pix_fmt
==
AV_PIX_FMT_RGB0
)
{
dst
=
p
->
data
[
plane
];
for
(
i
=
0
;
i
<
s
->
height
;
i
++
)
{
for
(
j
=
0
;
j
<
s
->
width
;
j
++
)
{
int
k
=
255
-
dst
[
4
*
j
+
3
];
int
r
=
(
255
-
dst
[
4
*
j
])
*
k
;
int
g
=
(
255
-
dst
[
4
*
j
+
1
])
*
k
;
int
b
=
(
255
-
dst
[
4
*
j
+
2
])
*
k
;
dst
[
4
*
j
]
=
r
*
257
>>
16
;
dst
[
4
*
j
+
1
]
=
g
*
257
>>
16
;
dst
[
4
*
j
+
2
]
=
b
*
257
>>
16
;
dst
[
4
*
j
+
3
]
=
255
;
}
dst
+=
p
->
linesize
[
plane
];
}
}
}
if
(
s
->
planar
&&
s
->
bppcount
>
2
)
{
...
...
libavcodec/version.h
View file @
90ab9a58
...
...
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 43
#define LIBAVCODEC_VERSION_MICRO 10
0
#define LIBAVCODEC_VERSION_MICRO 10
1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
...
...
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