Compile on libimagequant older than version 2.8.0

This commit is contained in:
dolphin6k 2020-08-17 17:20:05 +09:00
parent d248c61498
commit bfaca2c2cf
2 changed files with 11 additions and 5 deletions

View file

@ -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;

View file

@ -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