Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
212e7579
Commit
212e7579
authored
Feb 15, 2012
by
Sébastien Escudier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add exif jpeg detection to the image demuxer
parent
20bfa22b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
modules/demux/image.c
modules/demux/image.c
+21
-0
No files found.
modules/demux/image.c
View file @
212e7579
...
...
@@ -404,6 +404,24 @@ static bool IsSpiff(stream_t *s)
return
true
;
}
static
bool
IsExif
(
stream_t
*
s
)
{
const
uint8_t
*
header
;
int
size
=
stream_Peek
(
s
,
&
header
,
256
);
int
position
=
0
;
if
(
FindJpegMarker
(
&
position
,
header
,
size
)
!=
0xd8
)
return
false
;
if
(
FindJpegMarker
(
&
position
,
header
,
size
)
!=
0xe1
)
return
false
;
position
+=
2
;
/* Skip size */
if
(
position
+
5
>
size
)
return
false
;
if
(
memcmp
(
&
header
[
position
],
"Exif
\0
"
,
5
))
return
false
;
return
true
;
}
static
bool
IsTarga
(
stream_t
*
s
)
{
/* The header is not enough to ensure proper detection, we need
...
...
@@ -513,6 +531,9 @@ static const image_format_t formats[] = {
{
.
codec
=
VLC_CODEC_JPEG
,
.
detect
=
IsSpiff
,
},
{
.
codec
=
VLC_CODEC_JPEG
,
.
detect
=
IsExif
,
},
{
.
codec
=
VLC_CODEC_TARGA
,
.
detect
=
IsTarga
,
},
...
...
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