From bfaca2c2cf7dcdb775085c93a768982f620e557d Mon Sep 17 00:00:00 2001 From: dolphin6k Date: Mon, 17 Aug 2020 17:20:05 +0900 Subject: [PATCH] Compile on libimagequant older than version 2.8.0 --- src/tuxpaint.c | 10 ++++++++-- tuxpaint.spec | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 1b96c8b1c..45e60a343 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -25600,7 +25600,9 @@ static int export_gif(int *selected, int num_selected, char *dirname, char **d_n liq_attr *liq_handle; liq_image *input_image; liq_result *quantization_result; +#if LIQ_VERSION >= 20800 liq_error qtiz_status; +#endif const liq_palette *palette; int gif_speed; @@ -25705,9 +25707,13 @@ static int export_gif(int *selected, int num_selected, char *dirname, char **d_n show_progress_bar(screen); done = export_gif_monitor_events(); - qtiz_status = liq_image_quantize(input_image, liq_handle, &quantization_result); +#if LIQ_VERSION >= 20800 + qtiz_status = liq_image_quantize(input_image, liq_handle, &quantization_result); done = (qtiz_status != LIQ_OK); - +#else + quantization_result = liq_quantize_image(liq_handle, input_image); + done = (quantization_result != NULL); +#endif if (!done) { // Use libimagequant to make new image pixels from the palette pixels_size = num_selected * overall_area; diff --git a/tuxpaint.spec b/tuxpaint.spec index 0818fb1d7..56ce4e4fa 100644 --- a/tuxpaint.spec +++ b/tuxpaint.spec @@ -7,9 +7,9 @@ Group: Multimedia/Graphics URL: http://www.tuxpaint.org/ Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -Requires: SDL >= 1.2.4 SDL_image SDL_mixer SDL_ttf SDL_Pango libpaper fribidi xdg-utils +Requires: SDL >= 1.2.4 SDL_image SDL_mixer SDL_ttf SDL_Pango libpaper fribidi xdg-utils libimagequant BuildRequires: SDL-devel >= 1.2.4 SDL_image-devel SDL_mixer-devel SDL_ttf-devel SDL_Pango-devel -BuildRequires: librsvg2-devel libpaper-devel fribidi-devel gperf gettext ImageMagick xdg-utils +BuildRequires: librsvg2-devel libpaper-devel fribidi-devel gperf gettext ImageMagick xdg-utils libimagequant-devel %description "Tux Paint" is a drawing program for young children. @@ -36,7 +36,7 @@ development files for tuxpaint plugins. %setup -q %build -make PREFIX=%{_prefix} DOC_PREFIX=%{_docdir}/tuxpaint/en +make PREFIX=%{_prefix} DOC_PREFIX=%{_docdir}/tuxpaint/en linux_ARCH_CFLAGS=-I/usr/include/imagequant %install rm -rf $RPM_BUILD_ROOT