more help for graphicsmagick

but still not quite there
This commit is contained in:
John Cupitt 2018-04-24 17:14:51 +01:00
parent c410dc2db8
commit 38ea5937ca
3 changed files with 32 additions and 20 deletions

View File

@ -690,6 +690,26 @@ if test x"$magick6" = x"yes"; then
LIBS="$save_LIBS"
fi
if test x"$magick6" = x"yes"; then
# GM uses SetImageAttribute(), IM uses SetImageProperty()
save_LIBS="$LIBS"
LIBS="$LIBS $MAGICK_LIBS"
AC_CHECK_FUNCS(SetImageProperty,
AC_DEFINE(HAVE_SETIMAGEPROPERTY,1,
[define if your magick has SetImageProperty.]))
LIBS="$save_LIBS"
fi
if test x"$magick6" = x"yes"; then
# GM is missing InheritException
save_LIBS="$LIBS"
LIBS="$LIBS $MAGICK_LIBS"
AC_CHECK_FUNCS(InheritException,
AC_DEFINE(HAVE_INHERITEXCEPTION,1,
[define if your magick has InheritException.]))
LIBS="$save_LIBS"
fi
# have flags to turn load and save off independently ... some people will want
# save but not load, for example
AC_ARG_ENABLE([magickload],

View File

@ -82,13 +82,6 @@ magick_set_property( Image *image, const char *property, const char *value,
(void) SetImageProperty( image, property, value, exception );
}
int
magick_set_image_colorspace( Image *image, const ColorspaceType colorspace,
ExceptionInfo *exception)
{
return( SetImageColorspace( image, colorspace, exception ) );
}
void
magick_inherit_exception( ExceptionInfo *exception, Image *image )
{
@ -149,19 +142,20 @@ magick_set_image_size( Image *image, const size_t width, const size_t height,
int
magick_import_pixels( Image *image, const ssize_t x, const ssize_t y,
const size_t width, const size_t height, const char *map,
const StorageType type,const void *pixels, ExceptionInfo *exception )
const StorageType type, const void *pixels, ExceptionInfo *exception )
{
(void) exception;
/* GM does not seem to have a simple equivalent, unfortunately.
*
* Looks like we'd need to call
*
* extern MagickExport PixelPacket
* *SetImagePixels(Image *image,const long x,const long y,
* const unsigned long columns,const unsigned
* long rows);
*
* gets a pointer into the image which we can then write to, use that
* perhaps?
* then repack pixels into that area using map and storage_type.
*/
return( ImportImagePixels( image, x, y, width, height, map,
type, pixels ) );
@ -172,21 +166,19 @@ magick_set_property( Image *image, const char *property, const char *value,
ExceptionInfo *exception )
{
(void) exception;
#ifdef HAVE_SETIMAGEPROPERTY
(void) SetImageProperty( image, property, value );
}
int
magick_set_image_colorspace( Image *image, const ColorspaceType colorspace,
ExceptionInfo *exception )
{
(void) exception;
return( SetImageColorspace( image, colorspace ) );
#else /*!HAVE_SETIMAGEPROPERTY*/
(void) SetImageAttribute( image, property, value );
#endif /*HAVE_SETIMAGEPROPERTY*/
}
void
magick_inherit_exception( ExceptionInfo *exception, Image *image )
{
#ifdef HAVE_INHERITEXCEPTION
InheritException( exception, &image->exception );
#endif /*HAVE_INHERITEXCEPTION*/
}
#endif /*HAVE_MAGICK6*/

View File

@ -46,8 +46,8 @@ Image *magick_acquire_image( const ImageInfo *image_info,
ExceptionInfo *exception );
void magick_acquire_next_image( const ImageInfo *image_info,
Image *image, ExceptionInfo *exception );
int magick_set_image_size( Image *image, const size_t width, const size_t height,
ExceptionInfo *exception );
int magick_set_image_size( Image *image,
const size_t width, const size_t height, ExceptionInfo *exception );
int magick_import_pixels( Image *image, const ssize_t x, const ssize_t y,
const size_t width, const size_t height, const char *map,
const StorageType type,const void *pixels, ExceptionInfo *exception );