# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/rss_glx/hotfix-imagemagick7.patch # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- Port to the ImageMagick 7 MagickWand API. --- rss-glx_0.9.1.orig/configure.in +++ rss-glx_0.9.1/configure.in @@ -81,7 +81,7 @@ fi AC_CHECK_FUNCS(random_r nrand48) # Check for ImageMagick. -PKG_CHECK_MODULES(Wand, Wand >= 6.4) +PKG_CHECK_MODULES(Wand, MagickWand >= 7.0) if test -d src/skyrocket_sounds ; then AC_ARG_ENABLE(sound, [ --disable-sound Don't compile with sound.]) --- rss-glx_0.9.1.orig/src/TexMgr.cpp +++ rss-glx_0.9.1/src/TexMgr.cpp @@ -25,8 +25,8 @@ #endif #include -#include -#include +#include +#include #include #include #include @@ -255,11 +255,9 @@ static unsigned int computeDesiredSize(c // Directory scanning + image loading code in a separate function callable either from loadNextImage or another thread if pthreads is available. void TexMgr::loadNextImageFromDisk() { MagickWand *magick_wand = NewMagickWand(); - ExceptionInfo exception; + ExceptionInfo *exception = AcquireExceptionInfo (); int dirLoop = 0; - GetExceptionInfo (&exception); - int imageLoaded = 0; do { struct dirent *file; @@ -317,9 +315,10 @@ void TexMgr::loadNextImageFromDisk() { nextH = ohh; } - ExportImagePixels (GetImageFromMagickWand(magick_wand), 0, 0, oww, ohh, "RGBA", CharPixel, nextTex, &exception); + ExportImagePixels (GetImageFromMagickWand(magick_wand), 0, 0, oww, ohh, "RGBA", CharPixel, nextTex, exception); magick_wand = DestroyMagickWand (magick_wand); + exception = DestroyExceptionInfo (exception); ready = true; } --- rss-glx_0.9.1.orig/src/matrixview.c +++ rss-glx_0.9.1/src/matrixview.c @@ -84,8 +84,8 @@ float *pts; float *texcoords; unsigned char *colors; -#include -#include +#include +#include #include #include #include @@ -99,11 +99,9 @@ unsigned char *next_pic = NULL; // Directory scanning + image loading code in a separate function callable either from loadNextImage or another thread if pthreads is available. void loadNextImageFromDisk() { MagickWand *magick_wand = NewMagickWand(); - ExceptionInfo exception; + ExceptionInfo *exception = AcquireExceptionInfo (); int dirLoop = 0; - GetExceptionInfo (&exception); - int imageLoaded = 0; do { struct dirent *file; @@ -159,9 +157,10 @@ void loadNextImageFromDisk() { if (!next_pic) next_pic = (unsigned char *)malloc (text_x * text_y); - ExportImagePixels (GetImageFromMagickWand(magick_wand), 0, 0, text_x, text_y, "I", CharPixel, next_pic, &exception); + ExportImagePixels (GetImageFromMagickWand(magick_wand), 0, 0, text_x, text_y, "I", CharPixel, next_pic, exception); magick_wand = DestroyMagickWand (magick_wand); + exception = DestroyExceptionInfo (exception); } #include @@ -211,13 +210,11 @@ void loadNextImage () pthread_cond_signal(next_pic_cond); } } else { - ExceptionInfo exception; + ExceptionInfo *exception = AcquireExceptionInfo (); Image *image = NULL, *scaled_image; ImageInfo *image_info; - GetExceptionInfo (&exception); - - if (!pics) + if (!pics) LOAD_TEXTURE (pics, cpics, cpics_compressedsize, cpics_size) if ((text_x != 90) || (text_y != 70)) { @@ -227,13 +224,13 @@ void loadNextImage () image_info = CloneImageInfo ((ImageInfo *) NULL); image_info->size = AcquireMagickMemory(sizeof("90x70")); strcpy(image_info->size, "90x70"); - image = AcquireImage(image_info); + image = AcquireImage(image_info, exception); - ImportImagePixels(image, 0, 0, 90, 70, "I", CharPixel, (unsigned char *)(pics + ((random () & 15) * (90 * 70)))); + ImportImagePixels(image, 0, 0, 90, 70, "I", CharPixel, (unsigned char *)(pics + ((random () & 15) * (90 * 70))), exception); - scaled_image = ScaleImage (image, text_x, text_y, &exception); + scaled_image = ScaleImage (image, text_x, text_y, exception); - ExportImagePixels (scaled_image, 0, 0, text_x, text_y, "I", CharPixel, pic, &exception); + ExportImagePixels (scaled_image, 0, 0, text_x, text_y, "I", CharPixel, pic, exception); DestroyImage (image); DestroyImage (scaled_image); @@ -243,6 +240,7 @@ void loadNextImage () pic = (unsigned char *)(pics + ((random () & 15) * (text_x * text_y))); } + exception = DestroyExceptionInfo (exception); } }