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
9e01f171
Unverified
Commit
9e01f171
authored
Jan 10, 2020
by
Lynne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tiffdec: support embedded ICC profiles
parent
72254799
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
tiff.c
libavcodec/tiff.c
+18
-0
tiff.h
libavcodec/tiff.h
+1
-0
No files found.
libavcodec/tiff.c
View file @
9e01f171
...
...
@@ -1218,6 +1218,8 @@ static void set_sar(TiffContext *s, unsigned tag, unsigned num, unsigned den)
static
int
tiff_decode_tag
(
TiffContext
*
s
,
AVFrame
*
frame
)
{
AVFrameSideData
*
sd
;
GetByteContext
gb_temp
;
unsigned
tag
,
type
,
count
,
off
,
value
=
0
,
value2
=
1
;
// value2 is a denominator so init. to 1
int
i
,
start
;
int
pos
;
...
...
@@ -1643,6 +1645,22 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
}
}
break
;
case
TIFF_ICC_PROFILE
:
if
(
type
!=
TIFF_UNDEFINED
)
return
AVERROR_INVALIDDATA
;
gb_temp
=
s
->
gb
;
bytestream2_seek
(
&
gb_temp
,
SEEK_SET
,
off
);
if
(
bytestream2_get_bytes_left
(
&
gb_temp
)
<
count
)
return
AVERROR_INVALIDDATA
;
sd
=
av_frame_new_side_data
(
frame
,
AV_FRAME_DATA_ICC_PROFILE
,
count
);
if
(
!
sd
)
return
AVERROR
(
ENOMEM
);
bytestream2_get_bufferu
(
&
gb_temp
,
sd
->
data
,
count
);
break
;
case
TIFF_ARTIST
:
ADD_METADATA
(
count
,
"artist"
,
NULL
);
break
;
...
...
libavcodec/tiff.h
View file @
9e01f171
...
...
@@ -92,6 +92,7 @@ enum TiffTags {
TIFF_MODEL_TIEPOINT
=
0x8482
,
TIFF_MODEL_PIXEL_SCALE
=
0x830E
,
TIFF_MODEL_TRANSFORMATION
=
0x8480
,
TIFF_ICC_PROFILE
=
0x8773
,
TIFF_GEO_KEY_DIRECTORY
=
0x87AF
,
TIFF_GEO_DOUBLE_PARAMS
=
0x87B0
,
TIFF_GEO_ASCII_PARAMS
=
0x87B1
,
...
...
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