mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 20:50:44 +00:00
Disable to support to create gif image representations when giflib
does not define QuantizeBuffer. Fixes #38024. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35958 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1fe1e8d367
commit
0d760caf50
5 changed files with 125 additions and 0 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2013-01-13 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* configure.ac:
|
||||
* Headers/Additions/GNUstepGUI/config.h.in: Add check whether
|
||||
giflib defines QuantizeBuffer.
|
||||
|
||||
* Source/NSBitmapImageRep+GIF.m
|
||||
(_GIFRepresentationWithProperties:errorMessage:): Disable when
|
||||
QuantizeBuffer is not available.
|
||||
|
||||
* configure: Regenerated.
|
||||
|
||||
2013-01-13 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* configure.ac:
|
||||
|
|
|
@ -69,6 +69,9 @@
|
|||
/* Define to 1 if you have the <png.h> header file. */
|
||||
#undef HAVE_PNG_H
|
||||
|
||||
/* Define to 1 if you have the `QuantizeBuffer' function. */
|
||||
#undef HAVE_QUANTIZEBUFFER
|
||||
|
||||
/* Define to 1 if you have the `rint' function. */
|
||||
#undef HAVE_RINT
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ static void gs_gif_init_input_source(gs_gif_input_src *src, NSData *data)
|
|||
src->pos = 0;
|
||||
}
|
||||
|
||||
#if HAVE_QUANTIZEBUFFER
|
||||
/* Function to write GIF to buffer */
|
||||
static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
|
||||
{
|
||||
|
@ -121,6 +122,7 @@ static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
|
|||
[nsData appendBytes: buffer length: len];
|
||||
return len;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
The gif loading part of NSBitmapImageRep
|
||||
|
@ -384,6 +386,7 @@ static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
|
|||
- (NSData *) _GIFRepresentationWithProperties: (NSDictionary *) properties
|
||||
errorMessage: (NSString **)errorMsg
|
||||
{
|
||||
#if HAVE_QUANTIZEBUFFER
|
||||
NSMutableData * GIFRep = nil; // our return value
|
||||
GifFileType * GIFFile = NULL;
|
||||
GifByteType * rgbPlanes = NULL; // giflib needs planar RGB
|
||||
|
@ -534,6 +537,10 @@ static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
|
|||
free(GIFImage);
|
||||
|
||||
return GIFRep;
|
||||
#else
|
||||
NSLog(@"GIF representation is not available on this system.");
|
||||
return nil;
|
||||
#endif
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
98
configure
vendored
98
configure
vendored
|
@ -7021,6 +7021,104 @@ echo "$as_me: -gui will be linked against -lX11 to support libgif images" >&6;}
|
|||
fi
|
||||
fi
|
||||
|
||||
# QuantizeBuffer was removed from giflib in version 4.2 but is supposed
|
||||
# to make its return in the next release. If this function is not present
|
||||
# we disable the support to create gif image representations.
|
||||
|
||||
for ac_func in QuantizeBuffer
|
||||
do
|
||||
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
|
||||
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
|
||||
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
|
||||
For example, HP-UX 11i <limits.h> declares gettimeofday. */
|
||||
#define $ac_func innocuous_$ac_func
|
||||
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func (); below.
|
||||
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|
||||
<limits.h> exists even on freestanding compilers. */
|
||||
|
||||
#ifdef __STDC__
|
||||
# include <limits.h>
|
||||
#else
|
||||
# include <assert.h>
|
||||
#endif
|
||||
|
||||
#undef $ac_func
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char $ac_func ();
|
||||
/* The GNU C library defines this for functions which it implements
|
||||
to always fail with ENOSYS. Some functions are actually named
|
||||
something starting with __ and the normal name is an alias. */
|
||||
#if defined __stub_$ac_func || defined __stub___$ac_func
|
||||
choke me
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return $ac_func ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_link") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest$ac_exeext &&
|
||||
$as_test_x conftest$ac_exeext; then
|
||||
eval "$as_ac_var=yes"
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
eval "$as_ac_var=no"
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
fi
|
||||
ac_res=`eval echo '${'$as_ac_var'}'`
|
||||
{ echo "$as_me:$LINENO: result: $ac_res" >&5
|
||||
echo "${ECHO_T}$ac_res" >&6; }
|
||||
if test `eval echo '${'$as_ac_var'}'` = yes; then
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Find ImageMagick
|
||||
#--------------------------------------------------------------------
|
||||
|
|
|
@ -355,6 +355,11 @@ if test "$have_ungif" = no -o "${enable_libgif}" = yes; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# QuantizeBuffer was removed from giflib in version 4.2 but is supposed
|
||||
# to make its return in the next release. If this function is not present
|
||||
# we disable the support to create gif image representations.
|
||||
AC_CHECK_FUNCS(QuantizeBuffer)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Find ImageMagick
|
||||
#--------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue