Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
4649193f
Commit
4649193f
authored
May 01, 2016
by
Davis King
Browse files
Made dlib work with libgif v5
parent
9260243c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
dlib/image_loader/load_image.h
dlib/image_loader/load_image.h
+10
-3
No files found.
dlib/image_loader/load_image.h
View file @
4649193f
...
...
@@ -58,6 +58,13 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// handle the differences in API between libgif v5 and older.
#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
#define DLIB_GIFLIB_HANDLE_DIFF_VERSIONS ,0
#else
#define DLIB_GIFLIB_HANDLE_DIFF_VERSIONS
#endif
template
<
typename
image_type
>
void
load_image
(
image_type
&
image
,
...
...
@@ -79,7 +86,7 @@ namespace dlib
case
image_file_type
::
GIF
:
{
image_view
<
image_type
>
img
(
image
);
GifFileType
*
gif
=
DGifOpenFileName
(
file_name
.
c_str
());
GifFileType
*
gif
=
DGifOpenFileName
(
file_name
.
c_str
()
DLIB_GIFLIB_HANDLE_DIFF_VERSIONS
);
try
{
if
(
gif
==
0
)
throw
image_load_error
(
"Couldn't open file "
+
file_name
);
...
...
@@ -141,12 +148,12 @@ namespace dlib
}
}
}
DGifCloseFile
(
gif
);
DGifCloseFile
(
gif
DLIB_GIFLIB_HANDLE_DIFF_VERSIONS
);
}
catch
(...)
{
if
(
gif
)
DGifCloseFile
(
gif
);
DGifCloseFile
(
gif
DLIB_GIFLIB_HANDLE_DIFF_VERSIONS
);
throw
;
}
return
;
...
...
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