Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.io.image
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.io.image
Commits
3511f06f
Commit
3511f06f
authored
10 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Removed the newly introduced config.h since this package does not provide a C-API
parent
45866d77
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
bob/io/image/include/bob.io.image/config.h
+0
-84
0 additions, 84 deletions
bob/io/image/include/bob.io.image/config.h
bob/io/image/version.cpp
+64
-3
64 additions, 3 deletions
bob/io/image/version.cpp
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
65 additions
and
88 deletions
bob/io/image/include/bob.io.image/config.h
deleted
100644 → 0
+
0
−
84
View file @
45866d77
/**
* @author Manuel Guenther <manuel.guenther@idiap.ch>
* @date Thu 21 May 16:23:42 CEST 2015
*
* @brief Versioning information for bob.io.image
*/
#ifndef BOB_IO_IMAGE_CONFIG_H
#define BOB_IO_IMAGE_CONFIG_H
#ifdef BOB_IMPORT_VERSION
/***************************************
* Here we define some functions that should be used to build version dictionaries in the version.cpp file
* There will be a compiler warning, when these functions are not used, so use them!
***************************************/
#include
<Python.h>
#include
<boost/preprocessor/stringize.hpp>
extern
"C"
{
#include
<jpeglib.h>
#define PNG_SKIP_SETJMP_CHECK
// #define requires because of the problematic pngconf.h.
// Look at the thread here:
// https://bugs.launchpad.net/ubuntu/+source/libpng/+bug/218409
#include
<png.h>
#include
<gif_lib.h>
#include
<tiffio.h>
}
/**
* LibJPEG version
*/
static
PyObject
*
libjpeg_version
()
{
boost
::
format
f
(
"%d (compiled with %d bits depth)"
);
f
%
LIBJPEG_VERSION
%
BITS_IN_JSAMPLE
;
return
Py_BuildValue
(
"s"
,
f
.
str
().
c_str
());
}
/**
* Libpng version
*/
static
PyObject
*
libpng_version
()
{
return
Py_BuildValue
(
"s"
,
PNG_LIBPNG_VER_STRING
);
}
/**
* Libtiff version
*/
static
PyObject
*
libtiff_version
()
{
static
const
std
::
string
beg_str
(
"LIBTIFF, Version "
);
static
const
size_t
beg_len
=
beg_str
.
size
();
std
::
string
vtiff
(
TIFFGetVersion
());
// Remove first part if it starts with "LIBTIFF, Version "
if
(
vtiff
.
compare
(
0
,
beg_len
,
beg_str
)
==
0
)
vtiff
=
vtiff
.
substr
(
beg_len
);
// Remove multiple (copyright) lines if any
size_t
end_line
=
vtiff
.
find
(
"
\n
"
);
if
(
end_line
!=
std
::
string
::
npos
)
vtiff
=
vtiff
.
substr
(
0
,
end_line
);
return
Py_BuildValue
(
"s"
,
vtiff
.
c_str
());
}
/**
* Version of giflib support
*/
static
PyObject
*
giflib_version
()
{
#ifdef GIF_LIB_VERSION
return
Py_BuildValue
(
"s"
,
GIF_LIB_VERSION
);
#else
boost
::
format
f
(
"%s.%s.%s"
);
f
%
BOOST_PP_STRINGIZE
(
GIFLIB_MAJOR
)
%
BOOST_PP_STRINGIZE
(
GIFLIB_MINOR
)
%
BOOST_PP_STRINGIZE
(
GIFLIB_RELEASE
);
return
Py_BuildValue
(
"s"
,
f
.
str
().
c_str
());
#endif
}
#endif // BOB_IMPORT_VERSION
#endif
/* BOB_IO_IMAGE_CONFIG_H */
This diff is collapsed.
Click to expand it.
bob/io/image/version.cpp
+
64
−
3
View file @
3511f06f
...
...
@@ -10,7 +10,69 @@
#include
<bob.blitz/cleanup.h>
#include
<bob.core/config.h>
#include
<bob.io.base/config.h>
#include
<bob.io.image/config.h>
#include
<boost/preprocessor/stringize.hpp>
extern
"C"
{
#include
<jpeglib.h>
#define PNG_SKIP_SETJMP_CHECK
// #define requires because of the problematic pngconf.h.
// Look at the thread here:
// https://bugs.launchpad.net/ubuntu/+source/libpng/+bug/218409
#include
<png.h>
#include
<gif_lib.h>
#include
<tiffio.h>
}
/**
* LibJPEG version
*/
static
PyObject
*
libjpeg_version
()
{
boost
::
format
f
(
"%d (compiled with %d bits depth)"
);
f
%
LIBJPEG_VERSION
%
BITS_IN_JSAMPLE
;
return
Py_BuildValue
(
"s"
,
f
.
str
().
c_str
());
}
/**
* Libpng version
*/
static
PyObject
*
libpng_version
()
{
return
Py_BuildValue
(
"s"
,
PNG_LIBPNG_VER_STRING
);
}
/**
* Libtiff version
*/
static
PyObject
*
libtiff_version
()
{
static
const
std
::
string
beg_str
(
"LIBTIFF, Version "
);
static
const
size_t
beg_len
=
beg_str
.
size
();
std
::
string
vtiff
(
TIFFGetVersion
());
// Remove first part if it starts with "LIBTIFF, Version "
if
(
vtiff
.
compare
(
0
,
beg_len
,
beg_str
)
==
0
)
vtiff
=
vtiff
.
substr
(
beg_len
);
// Remove multiple (copyright) lines if any
size_t
end_line
=
vtiff
.
find
(
"
\n
"
);
if
(
end_line
!=
std
::
string
::
npos
)
vtiff
=
vtiff
.
substr
(
0
,
end_line
);
return
Py_BuildValue
(
"s"
,
vtiff
.
c_str
());
}
/**
* Version of giflib support
*/
static
PyObject
*
giflib_version
()
{
#ifdef GIF_LIB_VERSION
return
Py_BuildValue
(
"s"
,
GIF_LIB_VERSION
);
#else
boost
::
format
f
(
"%s.%s.%s"
);
f
%
BOOST_PP_STRINGIZE
(
GIFLIB_MAJOR
)
%
BOOST_PP_STRINGIZE
(
GIFLIB_MINOR
)
%
BOOST_PP_STRINGIZE
(
GIFLIB_RELEASE
);
return
Py_BuildValue
(
"s"
,
f
.
str
().
c_str
());
#endif
}
static
PyObject
*
build_version_dictionary
()
{
...
...
@@ -67,8 +129,7 @@ static PyObject* create_module (void) {
auto
m_
=
make_safe
(
m
);
///< protects against early returns
/* register version numbers and constants */
if
(
PyModule_AddStringConstant
(
m
,
"module"
,
BOB_EXT_MODULE_VERSION
)
<
0
)
return
0
;
if
(
PyModule_AddStringConstant
(
m
,
"module"
,
BOB_EXT_MODULE_VERSION
)
<
0
)
return
0
;
if
(
PyModule_AddObject
(
m
,
"externals"
,
build_version_dictionary
())
<
0
)
return
0
;
return
Py_BuildValue
(
"O"
,
m
);
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
3511f06f
...
...
@@ -446,7 +446,7 @@ setup(
boost_modules
=
boost_modules
,
bob_packages
=
bob_packages
,
version
=
version
,
system_include_dirs
=
system_include_dirs
+
[
'
bob/io/image/include
'
]
,
system_include_dirs
=
system_include_dirs
,
library_dirs
=
library_dirs
,
libraries
=
libraries
,
define_macros
=
define_macros
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment