Commit 5d9dd96d authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Include copy of GifQuantizeBuffer function from giflib

From https://github.com/coin3d/simage/pull/33
giflib 5.1.9 and above removes the GifQuantizeBuffer() function used in
simage_gif.c (see https://sourceforge.net/p/giflib/bugs/132/ and
https://sourceforge.net/p/giflib/bugs/142/).

The fix is either to remove the related check in simage_gif.c or to include a
copy of the function as encouraged by giflib, due the util library not being
included in installed versions of giflib (license is MIT):

    The undocumented and deprecated GifQuantizeBuffer() entry point has been
    moved to the util library to reduce libgif size and attack surface.
    Applications needing this function are couraged to link the util library or
    make their own copy.
parent 77d31bbc
Pipeline #44975 failed with stage
in 1 minute and 22 seconds
......@@ -25,6 +25,13 @@
extern "C" {
#include <gif_lib.h>
#if GIFLIB_MAJOR > 5 || GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 2 || GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 1 && GIFLIB_RELEASE >= 9
//see https://sourceforge.net/p/giflib/bugs/132/
//and https://sourceforge.net/p/giflib/bugs/142/
#include <quantize.h>
#endif
}
// QuantizeBuffer function definition that was inlined (only) in giflib 4.2
......
The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
This diff is collapsed.
/***************************************************************************
getarg.h - Support routines for the giflib utilities
SPDX-License-Identifier: MIT
**************************************************************************/
#ifndef QUANTIZE_H
#define QUANTIZE_H
#include <gif_lib.h>
/******************************************************************************
Color table quantization
******************************************************************************/
int GifQuantizeBuffer(unsigned int Width, unsigned int Height,
int *ColorMapSize, GifByteType * RedInput,
GifByteType * GreenInput, GifByteType * BlueInput,
GifByteType * OutputBuffer,
GifColorType * OutputColorMap);
#endif /*QUANTIZE_H */
/* end */
......@@ -10,6 +10,7 @@ from setuptools import setup, find_packages, dist
dist.Distribution(dict(setup_requires=['bob.extension', 'bob.blitz'] + bob_packages))
from bob.extension.utils import egrep, find_header, find_library
from bob.blitz.extension import Extension, Library, build_ext
from distutils.version import LooseVersion
from bob.extension.utils import load_requirements
build_requires = load_requirements()
......@@ -334,6 +335,8 @@ system_include_dirs = [
tiff_pkg.include_directory,
gif_pkg.include_directory,
]
if LooseVersion(gif_pkg.version) >= LooseVersion("5.1.9"):
system_include_dirs.append("bob/io/image/giflib")
library_dirs = [
jpeg_pkg.library_directory,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment