]> git.pld-linux.org Git - packages/transcode.git/blob - imagemagick7.patch
- release 17 (by relup.sh)
[packages/transcode.git] / imagemagick7.patch
1 diff -ur transcode-1.1.7/configure.in transcode-1.1.7-im7/configure.in
2 --- transcode-1.1.7/configure.in        2016-12-26 22:04:02.117673939 +0100
3 +++ transcode-1.1.7-im7/configure.in    2016-12-26 11:44:31.805929653 +0100
4 @@ -1105,8 +1105,8 @@
5  dnl ImageMagick
6  dnl
7  IMAGEMAGICK_EXTRA_LIBS="$IMAGEMAGICK_EXTRA_LIBS $($PKG_CONFIG --libs ImageMagick)"
8 -TC_PKG_CHECK(imagemagick, no, IMAGEMAGICK, no, [magick/api.h],
9 - none, InitializeMagick, Wand, [http://www.imagemagick.org/])
10 +TC_PKG_CHECK(imagemagick, no, IMAGEMAGICK, no, [MagickWand/MagickWand.h],
11 + none, InitializeMagick, MagickWand, [http://www.imagemagick.org/])
12  TC_PKG_HAVE(imagemagick, IMAGEMAGICK)
13  if test x"$have_imagemagick" = x"yes" ; then
14    SAVE_CPPFLAGS="$CPPFLAGS"
15 @@ -1114,6 +1114,7 @@
16    AC_CHECK_HEADER([wand/magick-wand.h],
17      [AC_DEFINE([HAVE_BROKEN_WAND], [1], ["have old wand header"])])
18    CPPFLAGS="$SAVE_CPPFLAGS"
19 +  IMAGEMAGICK_CFLAGS="$IMAGEMAGICK_CFLAGS $($PKG_CONFIG --cflags ImageMagick)"
20  fi
21  
22  dnl
23 diff -ur transcode-1.1.7/export/export_im.c transcode-1.1.7-im7/export/export_im.c
24 --- transcode-1.1.7/export/export_im.c  2011-11-19 17:50:27.000000000 +0100
25 +++ transcode-1.1.7-im7/export/export_im.c      2016-12-26 11:45:05.337246347 +0100
26 @@ -23,7 +23,7 @@
27  
28  /* Note: because of ImageMagick bogosity, this must be included first, so
29   * we can undefine the PACKAGE_* symbols it splats into our namespace */
30 -#include <magick/api.h>
31 +#include <MagickCore/MagickCore.h>
32  #undef PACKAGE_BUGREPORT
33  #undef PACKAGE_NAME
34  #undef PACKAGE_STRING
35 @@ -82,7 +82,7 @@
36  
37        codec = (vob->im_v_codec == CODEC_YUV) ? CODEC_YUV : CODEC_RGB;
38  
39 -      InitializeMagick("");
40 +      MagickCoreGenesis("", MagickFalse);
41  
42        image_info=CloneImageInfo((ImageInfo *) NULL);
43  
44 @@ -169,8 +169,8 @@
45  MOD_encode
46  {
47  
48 -  ExceptionInfo exception_info;
49 -  char *out_buffer = param->buffer;
50 +  ExceptionInfo *exception_info;
51 +  unsigned char *out_buffer = param->buffer;
52    Image *image=NULL;
53    int res;
54  
55 @@ -179,7 +179,7 @@
56  
57    if(param->flag == TC_VIDEO) {
58  
59 -    GetExceptionInfo(&exception_info);
60 +    exception_info = AcquireExceptionInfo();
61  
62      res = tc_snprintf(buf2, PATH_MAX, "%s%06d.%s", prefix, counter++, type);
63      if (res < 0) {
64 @@ -193,11 +193,11 @@
65        out_buffer = tmp_buffer;
66      }
67  
68 -    image=ConstituteImage (width, height, "RGB", CharPixel, out_buffer, &exception_info);
69 +    image=ConstituteImage (width, height, "RGB", CharPixel, out_buffer, exception_info);
70  
71      strlcpy(image->filename, buf2, MaxTextExtent);
72  
73 -    WriteImage(image_info, image);
74 +    WriteImage(image_info, image, exception_info);
75      DestroyImage(image);
76  
77      return(0);
78 @@ -220,8 +220,7 @@
79  
80    if(param->flag == TC_VIDEO) {
81      DestroyImageInfo(image_info);
82 -    ConstituteComponentTerminus();
83 -    DestroyMagick();
84 +    MagickCoreTerminus();
85  
86      free(tmp_buffer);
87      tmp_buffer = NULL;
88 diff -ur transcode-1.1.7/filter/filter_compare.c transcode-1.1.7-im7/filter/filter_compare.c
89 --- transcode-1.1.7/filter/filter_compare.c     2011-11-19 17:50:27.000000000 +0100
90 +++ transcode-1.1.7-im7/filter/filter_compare.c 2016-12-26 20:48:28.124184461 +0100
91 @@ -24,7 +24,7 @@
92  
93  /* Note: because of ImageMagick bogosity, this must be included first, so
94   * we can undefine the PACKAGE_* symbols it splats into our namespace */
95 -#include <magick/api.h>
96 +#include <MagickCore/MagickCore.h>
97  #undef PACKAGE_BUGREPORT
98  #undef PACKAGE_NAME
99  #undef PACKAGE_STRING
100 @@ -111,9 +111,9 @@
101         Image *pattern, *resized, *orig = 0;
102         ImageInfo *image_info;
103  
104 -       PixelPacket *pixel_packet;
105 +       Quantum *pixel_quantum;
106         pixelsMask *pixel_last;
107 -       ExceptionInfo exception_info;
108 +       ExceptionInfo *exception_info;
109  
110         if(ptr->tag & TC_FILTER_GET_CONFIG) {
111                 char buf[128];
112 @@ -139,7 +139,7 @@
113         if(ptr->tag & TC_FILTER_INIT)
114         {
115  
116 -               unsigned int t,r,index;
117 +               unsigned int t,r;
118                 pixelsMask *temp;
119  
120                 compare[instance] = tc_malloc(sizeof(compareData));
121 @@ -190,22 +190,22 @@
122                                 tc_log_perror(MOD_NAME, "could not open file for writing");
123                         }
124  
125 -                       InitializeMagick("");
126 +                       MagickCoreGenesis("", MagickFalse);
127                         if (verbose > 1)
128                  tc_log_info(MOD_NAME, "Magick Initialized successfully");
129  
130 -                       GetExceptionInfo(&exception_info);
131 +                       exception_info = AcquireExceptionInfo();
132                         image_info = CloneImageInfo ((ImageInfo *) NULL);
133                         strlcpy(image_info->filename, pattern_name, MaxTextExtent);
134                         if (verbose > 1)
135                              tc_log_info(MOD_NAME, "Trying to open image");
136                         orig = ReadImage(image_info,
137 -                                        &exception_info);
138 +                                        exception_info);
139  
140                         if (orig == (Image *) NULL) {
141 -                               MagickWarning(exception_info.severity,
142 -                                             exception_info.reason,
143 -                                             exception_info.description);
144 +                               MagickWarning(exception_info->severity,
145 +                                             exception_info->reason,
146 +                                             exception_info->description);
147                                 strlcpy(pattern_name, "/dev/null", sizeof(pattern_name));
148                         }else{
149                                if (verbose > 1)
150 @@ -228,42 +228,41 @@
151                 if (orig != NULL){
152                          // Flip and resize
153                         if (compare[instance]->vob->im_v_codec == CODEC_YUV)
154 -                               TransformRGBImage(orig,YCbCrColorspace);
155 +                               TransformImageColorspace(orig, YCbCrColorspace, exception_info);
156                         if (verbose > 1) tc_log_info(MOD_NAME, "Resizing the Image");
157                         resized = ResizeImage(orig,
158                                               compare[instance]->width,
159                                               compare[instance]->height,
160                                               GaussianFilter,
161 -                                             1,
162 -                                             &exception_info);
163 +                                             exception_info);
164                         if (verbose > 1)
165                                 tc_log_info(MOD_NAME, "Flipping the Image");
166 -                       pattern = FlipImage(resized, &exception_info);
167 +                       pattern = FlipImage(resized, exception_info);
168                         if (pattern == (Image *) NULL) {
169 -                               MagickError (exception_info.severity,
170 -                                            exception_info.reason,
171 -                                            exception_info.description);
172 +                               MagickError (exception_info->severity,
173 +                                            exception_info->reason,
174 +                                            exception_info->description);
175                         }
176  
177                         // Filling the matrix with the pixels values not
178                         // alpha
179  
180                         if (verbose > 1) tc_log_info(MOD_NAME, "GetImagePixels");
181 -                       pixel_packet = GetImagePixels(pattern,0,0,
182 +                       pixel_quantum = GetAuthenticPixels(pattern,0,0,
183                                                       pattern->columns,
184 -                                                     pattern->rows);
185 +                                                     pattern->rows,
186 +                                                     exception_info);
187  
188                         if (verbose > 1) tc_log_info(MOD_NAME, "Filling the Image matrix");
189                         for (t = 0; t < pattern->rows; t++)
190                                 for (r = 0; r < pattern->columns; r++){
191 -                                       index = t*pattern->columns + r;
192 -                                       if (pixel_packet[index].opacity == 0){
193 +                                       if (GetPixelAlpha(pattern, pixel_quantum) == QuantumRange) {
194                                                 temp=tc_malloc(sizeof(struct pixelsMask));
195                                                 temp->row=t;
196                                                 temp->col=r;
197 -                                               temp->r = (uint8_t)ScaleQuantumToChar(pixel_packet[index].red);
198 -                                               temp->g = (uint8_t)ScaleQuantumToChar(pixel_packet[index].green);
199 -                                               temp->b = (uint8_t)ScaleQuantumToChar(pixel_packet[index].blue);
200 +                                               temp->r = (uint8_t)ScaleQuantumToChar(GetPixelRed(pattern, pixel_quantum));
201 +                                               temp->g = (uint8_t)ScaleQuantumToChar(GetPixelGreen(pattern, pixel_quantum));
202 +                                               temp->b = (uint8_t)ScaleQuantumToChar(GetPixelBlue(pattern, pixel_quantum));
203                                                 temp->next=NULL;
204  
205                                                 if (pixel_last == NULL){
206 @@ -274,6 +273,7 @@
207                                                         pixel_last = temp;
208                                                 }
209                                         }
210 +                                       pixel_quantum += GetPixelChannels(pattern);
211                                 }
212  
213                         if (verbose)
214 @@ -297,7 +297,7 @@
215                         fclose(compare[instance]->results);
216                         free(compare[instance]);
217                 }
218 -               DestroyMagick();
219 +               MagickCoreTerminus();
220                 compare[instance]=NULL;
221  
222                 return(0);
223 diff -ur transcode-1.1.7/filter/filter_logoaway.c transcode-1.1.7-im7/filter/filter_logoaway.c
224 --- transcode-1.1.7/filter/filter_logoaway.c    2011-11-19 17:50:27.000000000 +0100
225 +++ transcode-1.1.7-im7/filter/filter_logoaway.c        2016-12-26 22:03:07.279566943 +0100
226 @@ -70,7 +70,7 @@
227  
228  /* Note: because of ImageMagick bogosity, this must be included first, so
229   * we can undefine the PACKAGE_* symbols it splats into our namespace */
230 -#include <magick/api.h>
231 +#include <MagickCore/MagickCore.h>
232  #undef PACKAGE_BUGREPORT
233  #undef PACKAGE_NAME
234  #undef PACKAGE_STRING
235 @@ -103,10 +103,10 @@
236  
237    int           alpha;
238  
239 -  ExceptionInfo exception_info;
240 +  ExceptionInfo *exception_info;
241    Image         *image;
242    ImageInfo     *image_info;
243 -  PixelPacket   *pixel_packet;
244 +  Quantum       *pixel_packet;
245  
246    int           dump;
247    char          *dump_buf;
248 @@ -174,7 +174,7 @@
249   *          instance    filter instance
250   * @return  void        nothing
251   *********************************************************/
252 -static void work_with_rgb_frame(logoaway_data *LD, char *buffer, int width, int height)
253 +static void work_with_rgb_frame(logoaway_data *LD, unsigned char *buffer, int width, int height)
254  {
255    int row, col, i;
256    int xdistance, ydistance, distance_west, distance_north;
257 @@ -201,10 +201,10 @@
258        }
259      }
260  
261 -    LD->dumpimage = ConstituteImage(LD->width-LD->xpos, LD->height-LD->ypos, "RGB", CharPixel, LD->dump_buf, &LD->exception_info);
262 +    LD->dumpimage = ConstituteImage(LD->width-LD->xpos, LD->height-LD->ypos, "RGB", CharPixel, LD->dump_buf, LD->exception_info);
263      tc_snprintf(LD->dumpimage->filename, MaxTextExtent, "dump[%d].png", LD->id);
264  
265 -    WriteImage(LD->dumpimage_info, LD->dumpimage);
266 +    WriteImage(LD->dumpimage_info, LD->dumpimage, LD->exception_info);
267    }
268  
269    switch(LD->mode) {
270 @@ -218,27 +218,28 @@
271        for(row=LD->ypos; row<LD->height; ++row) {
272          for(col=LD->xpos; col<LD->width; ++col) {
273  
274 +          Quantum *pixel = LD->pixel_packet + (row*LD->width+col)*GetPixelChannels(LD->image);
275            buf_off = ((height-row)*width+col) * 3;
276            pkt_off = (row-LD->ypos) * (LD->width-LD->xpos) + (col-LD->xpos);
277            /* R */
278            if (!LD->alpha) {
279                buffer[buf_off +0] = LD->rcolor;
280            } else {
281 -              alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].red);
282 +              alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, pixel));
283                buffer[buf_off +0] = alpha_blending(buffer[buf_off +0], LD->rcolor, alpha_px);
284            }
285            /* G */
286            if (!LD->alpha) {
287                buffer[buf_off +1] = LD->gcolor;
288            } else {
289 -              alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].green);
290 +              alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelGreen(LD->image, pixel));
291                buffer[buf_off +1] = alpha_blending(buffer[buf_off +1], LD->gcolor, alpha_px);
292            }
293            /* B */
294            if (!LD->alpha) {
295                buffer[buf_off +2] = LD->bcolor;
296            } else {
297 -              alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].blue);
298 +              alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelBlue(LD->image, pixel));
299                buffer[buf_off +2] = alpha_blending(buffer[buf_off +2], LD->bcolor, alpha_px);
300            }
301          }
302 @@ -268,6 +269,7 @@
303            buf_off = ((height-row)*width+col) * 3;
304  
305            pkt_off = (row-LD->ypos) * (LD->width-LD->xpos) + (col-LD->xpos);
306 +          Quantum *pixel = LD->pixel_packet + pkt_off*GetPixelChannels(LD->image);
307  
308            /* R */
309            hcalc  = alpha_blending(buffer[buf_off_xpos +0], buffer[buf_off_width  +0], alpha_hori);
310 @@ -276,7 +278,7 @@
311            if (!LD->alpha) {
312                buffer[buf_off +0] = new_px;
313            } else {
314 -              alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].red);
315 +              alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, pixel));
316                buffer[buf_off +0] = alpha_blending(buffer[buf_off +0], new_px, alpha_px);
317            }
318            /* G */
319 @@ -286,7 +288,7 @@
320            if (!LD->alpha) {
321                buffer[buf_off +1] = new_px;
322            } else {
323 -              alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].green);
324 +              alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelGreen(LD->image, pixel));
325                buffer[buf_off +1] = alpha_blending(buffer[buf_off +1], new_px, alpha_px);
326            }
327            /* B */
328 @@ -296,7 +298,7 @@
329            if (!LD->alpha) {
330                buffer[buf_off +2] = new_px;
331            } else {
332 -              alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].red);
333 +              alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelBlue(LD->image, pixel));
334                buffer[buf_off +2] = alpha_blending(buffer[buf_off +2], new_px, alpha_px);
335            }
336          }
337 @@ -327,28 +329,28 @@
338            buf_off_height = ((height-LD->height)*width+col) * 3;
339  
340            i = 0;
341 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off-i].red);
342 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off-i)*GetPixelChannels(LD->image)));
343            while ((alpha_px != 255) && (col-i>LD->xpos))
344              i++;
345            buf_off_xpos   = ((height-row)*width + col-i) * 3;
346            i = 0;
347 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off+i].red);
348 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off+i)*GetPixelChannels(LD->image)));
349            while ((alpha_px != 255) && (col+i<LD->width))
350              i++;
351            buf_off_width  = ((height-row)*width + col+i) * 3;
352  
353            i = 0;
354 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off-i*(LD->width-LD->xpos)].red);
355 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off-i*(LD->width-LD->xpos))*GetPixelChannels(LD->image)));
356            while ((alpha_px != 255) && (row-i>LD->ypos))
357              i++;
358            buf_off_ypos   = (height*width*3)-((row-i)*width - col) * 3;
359            i = 0;
360 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off+i*(LD->width-LD->xpos)].red);
361 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off+i*(LD->width-LD->xpos))*GetPixelChannels(LD->image)));
362            while ((alpha_px != 255) && (row+i<LD->height))
363              i++;
364            buf_off_height = (height*width*3)-((row+i)*width - col) * 3;
365  
366 -          alpha_px     = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].red);
367 +          alpha_px     = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + pkt_off*GetPixelChannels(LD->image)));
368            /* R */
369            hcalc  = alpha_blending(buffer[buf_off_xpos +0], buffer[buf_off_width  +0], alpha_hori);
370            vcalc  = alpha_blending(buffer[buf_off_ypos +0], buffer[buf_off_height +0], alpha_vert);
371 @@ -405,7 +407,7 @@
372   *          instance    filter instance
373   * @return  void        nothing
374   *********************************************************/
375 -static void work_with_yuv_frame(logoaway_data *LD, char *buffer, int width, int height)
376 +static void work_with_yuv_frame(logoaway_data *LD, unsigned char *buffer, int width, int height)
377  {
378    int row, col, i;
379    int craddr, cbaddr;
380 @@ -431,10 +433,11 @@
381  
382            buf_off = row*width+col;
383            pkt_off = (row-LD->ypos) * (LD->width-LD->xpos) + (col-LD->xpos);
384 +         Quantum *pixel = LD->pixel_packet + pkt_off*GetPixelChannels(LD->image);
385            if (!LD->alpha) {
386              buffer[buf_off] = LD->ycolor;
387            } else {
388 -            alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].red);
389 +            alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, pixel));
390              buffer[buf_off] = alpha_blending(buffer[buf_off], LD->ycolor, alpha_px);
391            }
392          }
393 @@ -446,8 +449,9 @@
394  
395            buf_off = row*width/2+col;
396            pkt_off = (row*2-LD->ypos) * (LD->width-LD->xpos) + (col*2-LD->xpos);
397 +         Quantum *pixel = LD->pixel_packet + pkt_off*GetPixelChannels(LD->image);
398            /* sic */
399 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].red);
400 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, pixel));
401            if (!LD->alpha) {
402              buffer[craddr + buf_off] = LD->ucolor;
403              buffer[cbaddr + buf_off] = LD->vcolor;
404 @@ -483,10 +487,11 @@
405            buf_off_height = LD->height*width+col;
406  
407            pkt_off = (row-LD->ypos) * (LD->width-LD->xpos) + (col-LD->xpos);
408 +         Quantum *pixel = LD->pixel_packet + pkt_off*GetPixelChannels(LD->image);
409  
410            hcalc = alpha_blending(buffer[buf_off_xpos], buffer[buf_off_width],  alpha_hori);
411            vcalc = alpha_blending(buffer[buf_off_ypos], buffer[buf_off_height], alpha_vert);
412 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].red);
413 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, pixel));
414            new_px = (hcalc*LD->xweight + vcalc*LD->yweight)/100;
415            if (!LD->alpha) {
416              buffer[buf_off] = new_px;
417 @@ -517,7 +522,8 @@
418            buf_off_height = LD->height/2*width/2+col;
419  
420            pkt_off = (row*2-LD->ypos) * (LD->width-LD->xpos) + (col*2-LD->xpos);
421 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].red); 
422 +         Quantum *pixel = LD->pixel_packet + pkt_off*GetPixelChannels(LD->image);
423 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, pixel)); 
424            /* sic, reuse red alpha_px */
425  
426            hcalc  = alpha_blending(buffer[craddr + buf_off_xpos], buffer[craddr + buf_off_width],  alpha_hori);
427 @@ -560,30 +566,30 @@
428            pkt_off = (row-LD->ypos) * (LD->width-LD->xpos) + (col-LD->xpos);
429  
430            i = 0;
431 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off-i].red);
432 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off-i)*GetPixelChannels(LD->image)));
433            while ((alpha_px != 255) && (col-i>LD->xpos))
434              i++;
435            buf_off_xpos   = (row*width + col-i);
436            i = 0;
437 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off+i].red);
438 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off+i)*GetPixelChannels(LD->image)));
439            while ((alpha_px != 255) && (col+i<LD->width))
440              i++;
441            buf_off_width  = (row*width + col+i);
442  
443            i = 0;
444 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off-i*(LD->width-LD->xpos)].red);
445 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off-i*(LD->width-LD->xpos))*GetPixelChannels(LD->image)));
446            while ((alpha_px != 255) && (row-i>LD->ypos))
447              i++;
448            buf_off_ypos   = ((row-i)*width + col);
449            i = 0;
450 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off+i*(LD->width-LD->xpos)].red);
451 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off+i*(LD->width-LD->xpos))*GetPixelChannels(LD->image)));
452            while ((alpha_px != 255) && (row+i<LD->height))
453              i++;
454            buf_off_height = ((row+i)*width + col);
455  
456            hcalc  = alpha_blending( buffer[buf_off_xpos], buffer[buf_off_width],  alpha_hori );
457            vcalc  = alpha_blending( buffer[buf_off_ypos], buffer[buf_off_height], alpha_vert );
458 -          alpha_px     = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].red);
459 +          alpha_px     = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + pkt_off*GetPixelChannels(LD->image)));
460            new_px = (hcalc*LD->xweight + vcalc*LD->yweight)/100;
461            buffer[buf_off] = alpha_blending(buffer[buf_off], new_px, alpha_px);
462          }
463 @@ -603,23 +609,23 @@
464            alpha_hori = xdistance * distance_west;
465  
466            i = 0;
467 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off-i].red);
468 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off-i)*GetPixelChannels(LD->image)));
469            while ((alpha_px != 255) && (col-i>LD->xpos))
470              i++;
471            buf_off_xpos   = (row*width/2 + col-i);
472            i = 0;
473 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off+i].red);
474 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off+i)*GetPixelChannels(LD->image)));
475            while ((alpha_px != 255) && (col+i<LD->width))
476              i++;
477            buf_off_width  = (row*width/2 + col+i);
478  
479            i = 0;
480 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off-i*(LD->width-LD->xpos)].red);
481 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off-i*(LD->width-LD->xpos))*GetPixelChannels(LD->image)));
482            while ((alpha_px != 255) && (row-i>LD->ypos))
483              i++;
484            buf_off_ypos   = ((row-i)*width/2 + col);
485            i = 0;
486 -          alpha_px = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off+i*(LD->width-LD->xpos)].red);
487 +          alpha_px = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + (pkt_off+i*(LD->width-LD->xpos))*GetPixelChannels(LD->image)));
488            while ((alpha_px != 255) && (row+i<LD->height))
489              i++;
490            buf_off_height = ((row+i)*width/2 + col);
491 @@ -630,7 +636,7 @@
492  
493            pkt_off = (row*2-LD->ypos) * (LD->width-LD->xpos) + (col*2-LD->xpos);
494  
495 -          alpha_px    = (uint8_t)ScaleQuantumToChar(LD->pixel_packet[pkt_off].red);
496 +          alpha_px    = (uint8_t)ScaleQuantumToChar(GetPixelRed(LD->image, LD->pixel_packet + pkt_off*GetPixelChannels(LD->image)));
497            /* sic: reuse the red component */
498            hcalc  = alpha_blending(buffer[craddr + buf_off_xpos], buffer[craddr + buf_off_width],  alpha_hori);
499            vcalc  = alpha_blending(buffer[craddr + buf_off_ypos], buffer[craddr + buf_off_height], alpha_vert);
500 @@ -815,17 +821,17 @@
501      }
502  
503      if((data[instance]->alpha) || (data[instance]->dump)) {
504 -      InitializeMagick("");
505 -      GetExceptionInfo(&data[instance]->exception_info);
506 +      MagickCoreGenesis("", MagickFalse);
507 +      data[instance]->exception_info = AcquireExceptionInfo();
508  
509        if(data[instance]->alpha) {
510          data[instance]->image_info = CloneImageInfo((ImageInfo *) NULL);
511  
512          strlcpy(data[instance]->image_info->filename, data[instance]->file, MaxTextExtent);
513 -        data[instance]->image = ReadImage(data[instance]->image_info, &data[instance]->exception_info);
514 +        data[instance]->image = ReadImage(data[instance]->image_info, data[instance]->exception_info);
515          if (data[instance]->image == (Image *) NULL) {
516            tc_log_error(MOD_NAME, "\n");
517 -          MagickWarning (data[instance]->exception_info.severity, data[instance]->exception_info.reason, data[instance]->exception_info.description);
518 +          MagickWarning (data[instance]->exception_info->severity, data[instance]->exception_info->reason, data[instance]->exception_info->description);
519            return TC_ERROR;
520          }
521  
522 @@ -835,7 +841,7 @@
523            return TC_ERROR;
524          }
525  
526 -        data[instance]->pixel_packet = GetImagePixels(data[instance]->image, 0, 0, data[instance]->image->columns, data[instance]->image->rows);
527 +        data[instance]->pixel_packet = GetAuthenticPixels(data[instance]->image, 0, 0, data[instance]->image->columns, data[instance]->image->rows, data[instance]->exception_info);
528        }
529        if(data[instance]->dump) {
530          if((data[instance]->dump_buf = tc_malloc ((data[instance]->width-data[instance]->xpos)*(data[instance]->height-data[instance]->ypos)*3)) == NULL)
531 @@ -865,10 +871,9 @@
532      if (data[instance]->dumpimage != (Image *)NULL) {
533        DestroyImage(data[instance]->dumpimage);
534        DestroyImageInfo(data[instance]->dumpimage_info);
535 -      ConstituteComponentTerminus();
536      }
537 -    DestroyExceptionInfo(&data[instance]->exception_info);
538 -    DestroyMagick();
539 +    DestroyExceptionInfo(data[instance]->exception_info);
540 +    MagickCoreTerminus();
541  
542      if(data[instance]->dump_buf) free(data[instance]->dump_buf);
543      if(data[instance]) free(data[instance]);
544 diff -ur transcode-1.1.7/filter/filter_logo.c transcode-1.1.7-im7/filter/filter_logo.c
545 --- transcode-1.1.7/filter/filter_logo.c        2011-11-19 17:50:27.000000000 +0100
546 +++ transcode-1.1.7-im7/filter/filter_logo.c    2016-12-26 21:09:56.135510915 +0100
547 @@ -36,7 +36,7 @@
548  
549  /* Note: because of ImageMagick bogosity, this must be included first, so
550   * we can undefine the PACKAGE_* symbols it splats into our namespace */
551 -#include <magick/api.h>
552 +#include <MagickCore/MagickCore.h>
553  #undef PACKAGE_BUGREPORT
554  #undef PACKAGE_NAME
555  #undef PACKAGE_STRING
556 @@ -227,7 +227,8 @@
557                                 ImageFormat  ifmt,
558                                 int          do_rgbswap)
559  {
560 -    PixelPacket *pixel_packet;
561 +    ExceptionInfo *exception_info;
562 +    Quantum *pixel_packet;
563      uint8_t *dst_ptr = dst;
564  
565      int row, col;
566 @@ -246,16 +247,17 @@
567      }
568      g_off = 1;
569  
570 -    pixel_packet = GetImagePixels(src, 0, 0, width, height);
571 +    exception_info = AcquireExceptionInfo();
572 +    pixel_packet = GetAuthenticPixels(src, 0, 0, width, height, exception_info);
573  
574      for (row = 0; row < height; row++) {
575          for (col = 0; col < width; col++) {
576 -            *(dst_ptr + r_off) = (uint8_t)ScaleQuantumToChar(pixel_packet->red);
577 -            *(dst_ptr + g_off) = (uint8_t)ScaleQuantumToChar(pixel_packet->green);
578 -            *(dst_ptr + b_off) = (uint8_t)ScaleQuantumToChar(pixel_packet->blue);
579 +            *(dst_ptr + r_off) = (uint8_t)ScaleQuantumToChar(GetPixelRed(src, pixel_packet));
580 +            *(dst_ptr + g_off) = (uint8_t)ScaleQuantumToChar(GetPixelGreen(src, pixel_packet));
581 +            *(dst_ptr + b_off) = (uint8_t)ScaleQuantumToChar(GetPixelBlue(src, pixel_packet));
582  
583              dst_ptr += 3;
584 -            pixel_packet++;
585 +            pixel_packet += GetPixelChannels(src);
586          }
587      }
588  
589 @@ -310,7 +312,7 @@
590          Image         *timg;
591          Image         *nimg;
592          ImageInfo     *image_info;
593 -        ExceptionInfo  exception_info;
594 +        ExceptionInfo *exception_info;
595  
596          int rgb_off = 0;
597  
598 @@ -376,19 +378,19 @@
599           * semaphore.
600           */
601          magick_usecount++;
602 -        if (!IsMagickInstantiated()) {
603 -            InitializeMagick("");
604 +        if (!IsMagickCoreInstantiated()) {
605 +            MagickCoreGenesis("", MagickFalse);
606          }
607  
608 -        GetExceptionInfo(&exception_info);
609 +        exception_info = AcquireExceptionInfo();
610          image_info = CloneImageInfo((ImageInfo *) NULL);
611          strlcpy(image_info->filename, mfd->file, MaxTextExtent);
612  
613 -        mfd->image = ReadImage(image_info, &exception_info);
614 +        mfd->image = ReadImage(image_info, exception_info);
615          if (mfd->image == (Image *) NULL) {
616 -            MagickWarning(exception_info.severity,
617 -                          exception_info.reason,
618 -                          exception_info.description);
619 +            MagickWarning(exception_info->severity,
620 +                          exception_info->reason,
621 +                          exception_info->description);
622              strlcpy(mfd->file, "/dev/null", PATH_MAX);
623              return 0;
624          }
625 @@ -413,11 +415,11 @@
626  
627          while (mfd->images != (Image *)NULL) {
628              if (mfd->flip || flip) {
629 -                timg = FlipImage(mfd->images, &exception_info);
630 +                timg = FlipImage(mfd->images, exception_info);
631                  if (timg == (Image *) NULL) {
632 -                    MagickError(exception_info.severity,
633 -                                exception_info.reason,
634 -                                exception_info.description);
635 +                    MagickError(exception_info->severity,
636 +                                exception_info->reason,
637 +                                exception_info->description);
638                      return -1;
639                  }
640                  AppendImageToList(&nimg, timg);
641 @@ -573,7 +575,7 @@
642          /* Set up image/video coefficient lookup tables */
643          if (img_coeff_lookup[0] < 0) {
644              int i;
645 -            float maxrgbval = (float)MaxRGB; // from ImageMagick
646 +            float maxrgbval = (float)QuantumRange; // from ImageMagick
647  
648              for (i = 0; i <= MAX_UINT8_VAL; i++) {
649                  float x = (float)ScaleCharToQuantum(i);
650 @@ -615,8 +617,8 @@
651          }
652  
653          magick_usecount--;
654 -        if (magick_usecount == 0 && IsMagickInstantiated()) {
655 -            DestroyMagick();
656 +        if (magick_usecount == 0 && IsMagickCoreInstantiated()) {
657 +            MagickCoreTerminus();
658          }
659  
660          return 0;
661 @@ -638,7 +640,8 @@
662          && (ptr->tag & TC_VIDEO)
663          && !(ptr->attributes & TC_FRAME_IS_SKIPPED)
664      ) {
665 -        PixelPacket *pixel_packet;
666 +        ExceptionInfo *exception_info;
667 +        Quantum *pixel_packet;
668          uint8_t     *video_buf;
669  
670          int   do_fade    = 0;
671 @@ -647,6 +650,7 @@
672  
673          /* Note: ImageMagick defines opacity = 0 as fully visible, and
674           * opacity = MaxRGB as fully transparent.
675 +         * alpha rather than opacity (0 transparent; QuantumRange opaque).
676           */
677          Quantum opacity;
678  
679 @@ -682,9 +686,11 @@
680              mfd->cur_delay = mfd->images->delay * vob->fps/100;
681          }
682  
683 -        pixel_packet = GetImagePixels(mfd->images, 0, 0,
684 +        exception_info = AcquireExceptionInfo();
685 +        pixel_packet = GetAuthenticPixels(mfd->images, 0, 0,
686                                        mfd->images->columns,
687 -                                      mfd->images->rows);
688 +                                      mfd->images->rows,
689 +                                      exception_info);
690  
691          if (vob->im_v_codec == CODEC_RGB) {
692              unsigned long r_off, g_off, b_off;
693 @@ -702,30 +708,30 @@
694                  video_buf = ptr->video_buf + 3 * ((row + mfd->posy) * vob->ex_v_width + mfd->posx);
695  
696                  for (col = 0; col < mfd->image->columns; col++) {
697 -                    opacity = pixel_packet->opacity;
698 +                    opacity = QuantumRange - GetPixelAlpha(mfd->images, pixel_packet);
699  
700                      if (do_fade)
701 -                        opacity += (Quantum)((MaxRGB - opacity) * fade_coeff);
702 +                        opacity += (Quantum)((QuantumRange - opacity) * fade_coeff);
703  
704                      if (opacity == 0) {
705 -                        *(video_buf + r_off) = ScaleQuantumToChar(pixel_packet->red);
706 -                        *(video_buf + g_off) = ScaleQuantumToChar(pixel_packet->green);
707 -                        *(video_buf + b_off) = ScaleQuantumToChar(pixel_packet->blue);
708 -                    } else if (opacity < MaxRGB) {
709 +                        *(video_buf + r_off) = ScaleQuantumToChar(GetPixelRed(mfd->images, pixel_packet));
710 +                        *(video_buf + g_off) = ScaleQuantumToChar(GetPixelGreen(mfd->images, pixel_packet));
711 +                        *(video_buf + b_off) = ScaleQuantumToChar(GetPixelBlue(mfd->images, pixel_packet));
712 +                    } else if (opacity < QuantumRange) {
713                          unsigned char opacity_uchar = ScaleQuantumToChar(opacity);
714                          img_coeff = img_coeff_lookup[opacity_uchar];
715                          vid_coeff = vid_coeff_lookup[opacity_uchar];
716  
717                          *(video_buf + r_off) = (uint8_t)((*(video_buf + r_off)) * vid_coeff)
718 -                                                + (uint8_t)(ScaleQuantumToChar(pixel_packet->red)   * img_coeff);
719 +                                                + (uint8_t)(ScaleQuantumToChar(GetPixelRed(mfd->images, pixel_packet))   * img_coeff);
720                          *(video_buf + g_off) = (uint8_t)((*(video_buf + g_off)) * vid_coeff)
721 -                                                + (uint8_t)(ScaleQuantumToChar(pixel_packet->green) * img_coeff);
722 +                                                + (uint8_t)(ScaleQuantumToChar(GetPixelGreen(mfd->images, pixel_packet)) * img_coeff);
723                          *(video_buf + b_off) = (uint8_t)((*(video_buf + b_off)) * vid_coeff)
724 -                                                + (uint8_t)(ScaleQuantumToChar(pixel_packet->blue)  * img_coeff);
725 +                                                + (uint8_t)(ScaleQuantumToChar(GetPixelBlue(mfd->images, pixel_packet))  * img_coeff);
726                      }
727  
728                      video_buf += 3;
729 -                    pixel_packet++;
730 +                    pixel_packet += GetPixelChannels(mfd->images);
731                  }
732              }
733          } else { /* !RGB */
734 @@ -745,10 +751,10 @@
735                  vid_pixel_V = vid_pixel_U + vid_size/4;
736                  for (col = 0; col < mfd->images->columns; col++) {
737                      int do_UV_pixels = (mfd->grayout == 0 && !(row % 2) && !(col % 2)) ? 1 : 0;
738 -                    opacity = pixel_packet->opacity;
739 +                    opacity = QuantumRange - GetPixelAlpha(mfd->images, pixel_packet);
740  
741                      if (do_fade)
742 -                        opacity += (Quantum)((MaxRGB - opacity) * fade_coeff);
743 +                        opacity += (Quantum)((QuantumRange - opacity) * fade_coeff);
744  
745                      if (opacity == 0) {
746                          *vid_pixel_Y = *img_pixel_Y;
747 @@ -756,7 +762,7 @@
748                                  *vid_pixel_U = *img_pixel_U;
749                                  *vid_pixel_V = *img_pixel_V;
750                          }
751 -                    } else if (opacity < MaxRGB) {
752 +                    } else if (opacity < QuantumRange) {
753                          unsigned char opacity_uchar = ScaleQuantumToChar(opacity);
754                          img_coeff = img_coeff_lookup[opacity_uchar];
755                          vid_coeff = vid_coeff_lookup[opacity_uchar];
756 diff -ur transcode-1.1.7/import/import_im.c transcode-1.1.7-im7/import/import_im.c
757 --- transcode-1.1.7/import/import_im.c  2011-11-19 17:50:27.000000000 +0100
758 +++ transcode-1.1.7-im7/import/import_im.c      2016-12-26 12:04:52.990550511 +0100
759 @@ -34,9 +34,9 @@
760  /* Note: because of ImageMagick bogosity, this must be included first, so
761   * we can undefine the PACKAGE_* symbols it splats into our namespace */
762  #ifdef HAVE_BROKEN_WAND
763 -#include <wand/magick-wand.h>
764 +#include <MagickWand/MagickWand.h>
765  #else /* we have a SANE wand header */
766 -#include <wand/MagickWand.h>
767 +#include <MagickWand/MagickWand.h>
768  #endif /* HAVE_BROKEN_WAND */
769  
770  #undef PACKAGE_BUGREPORT
771 diff -ur transcode-1.1.7/import/import_imlist.c transcode-1.1.7-im7/import/import_imlist.c
772 --- transcode-1.1.7/import/import_imlist.c      2011-11-19 17:50:27.000000000 +0100
773 +++ transcode-1.1.7-im7/import/import_imlist.c  2016-12-26 12:04:52.990550511 +0100
774 @@ -34,9 +34,9 @@
775  /* Note: because of ImageMagick bogosity, this must be included first, so
776   * we can undefine the PACKAGE_* symbols it splats into our namespace */
777  #ifdef HAVE_BROKEN_WAND
778 -#include <wand/magick-wand.h>
779 +#include <MagickWand/MagickWand.h>
780  #else /* we have a SANE wand header */
781 -#include <wand/MagickWand.h>
782 +#include <MagickWand/MagickWand.h>
783  #endif /* HAVE_BROKEN_WAND */
784  
785  #undef PACKAGE_BUGREPORT
786 diff -ur transcode-1.1.7/import/probe_im.c transcode-1.1.7-im7/import/probe_im.c
787 --- transcode-1.1.7/import/probe_im.c   2011-11-19 17:50:27.000000000 +0100
788 +++ transcode-1.1.7-im7/import/probe_im.c       2016-12-26 12:04:19.415578451 +0100
789 @@ -40,9 +40,9 @@
790  # undef PACKAGE_VERSION
791  
792  # ifdef HAVE_BROKEN_WAND
793 -# include <wand/magick-wand.h>
794 +# include <MagickWand/MagickWand.h>
795  # else /* we have a SANE wand header */
796 -# include <wand/MagickWand.h>
797 +# include <MagickWand/MagickWand.h>
798  # endif /* HAVE_BROKEN_WAND */
799  
800  # undef PACKAGE_BUGREPORT
This page took 0.11549 seconds and 3 git commands to generate.