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
0158dd14
Commit
0158dd14
authored
May 09, 2019
by
Jacob Graff
Committed by
Paul B Mahol
May 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/gif: fix issues with transparent crop
Resolves issues with some transparent gifs.
parent
68bac506
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
gif.c
libavcodec/gif.c
+6
-6
No files found.
libavcodec/gif.c
View file @
0158dd14
...
@@ -136,7 +136,7 @@ static void gif_crop_translucent(AVCodecContext *avctx,
...
@@ -136,7 +136,7 @@ static void gif_crop_translucent(AVCodecContext *avctx,
while
(
*
y_start
<
y_end
)
{
while
(
*
y_start
<
y_end
)
{
int
is_trans
=
1
;
int
is_trans
=
1
;
for
(
int
i
=
0
;
i
<
w
;
i
++
)
{
for
(
int
i
=
0
;
i
<
w
;
i
++
)
{
if
(
buf
[
w
*
*
y_start
+
i
]
!=
trans
)
{
if
(
buf
[
linesize
*
*
y_start
+
i
]
!=
trans
)
{
is_trans
=
0
;
is_trans
=
0
;
break
;
break
;
}
}
...
@@ -148,10 +148,10 @@ static void gif_crop_translucent(AVCodecContext *avctx,
...
@@ -148,10 +148,10 @@ static void gif_crop_translucent(AVCodecContext *avctx,
}
}
// crop bottom
// crop bottom
while
(
y_end
<
h
)
{
while
(
y_end
>
*
y_start
)
{
int
is_trans
=
1
;
int
is_trans
=
1
;
for
(
int
i
=
0
;
i
<
w
;
i
++
)
{
for
(
int
i
=
0
;
i
<
w
;
i
++
)
{
if
(
buf
[
w
*
y_end
+
i
]
!=
trans
)
{
if
(
buf
[
linesize
*
y_end
+
i
]
!=
trans
)
{
is_trans
=
0
;
is_trans
=
0
;
break
;
break
;
}
}
...
@@ -165,7 +165,7 @@ static void gif_crop_translucent(AVCodecContext *avctx,
...
@@ -165,7 +165,7 @@ static void gif_crop_translucent(AVCodecContext *avctx,
while
(
*
x_start
<
x_end
)
{
while
(
*
x_start
<
x_end
)
{
int
is_trans
=
1
;
int
is_trans
=
1
;
for
(
int
i
=
*
y_start
;
i
<
y_end
;
i
++
)
{
for
(
int
i
=
*
y_start
;
i
<
y_end
;
i
++
)
{
if
(
buf
[
w
*
i
+
*
x_start
]
!=
trans
)
{
if
(
buf
[
linesize
*
i
+
*
x_start
]
!=
trans
)
{
is_trans
=
0
;
is_trans
=
0
;
break
;
break
;
}
}
...
@@ -176,10 +176,10 @@ static void gif_crop_translucent(AVCodecContext *avctx,
...
@@ -176,10 +176,10 @@ static void gif_crop_translucent(AVCodecContext *avctx,
}
}
// crop right
// crop right
while
(
x_end
<
w
)
{
while
(
x_end
>
*
x_start
)
{
int
is_trans
=
1
;
int
is_trans
=
1
;
for
(
int
i
=
*
y_start
;
i
<
y_end
;
i
++
)
{
for
(
int
i
=
*
y_start
;
i
<
y_end
;
i
++
)
{
if
(
buf
[
w
*
i
+
x_end
]
!=
trans
)
{
if
(
buf
[
linesize
*
i
+
x_end
]
!=
trans
)
{
is_trans
=
0
;
is_trans
=
0
;
break
;
break
;
}
}
...
...
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