rmagick 4.3.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rmagick might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +0 -1
- data/CHANGELOG.md +20 -0
- data/README.md +5 -14
- data/before_install_osx.sh +2 -1
- data/ext/RMagick/extconf.rb +72 -36
- data/ext/RMagick/rmagick.h +24 -18
- data/ext/RMagick/rmagick_gvl.h +224 -0
- data/ext/RMagick/rmdraw.c +107 -128
- data/ext/RMagick/rmenum.c +34 -15
- data/ext/RMagick/rmfill.c +77 -16
- data/ext/RMagick/rmilist.c +158 -70
- data/ext/RMagick/rmimage.c +1073 -596
- data/ext/RMagick/rminfo.c +108 -124
- data/ext/RMagick/rmkinfo.c +43 -13
- data/ext/RMagick/rmmain.c +7 -9
- data/ext/RMagick/rmmontage.c +41 -20
- data/ext/RMagick/rmpixel.c +64 -40
- data/ext/RMagick/rmutil.c +10 -89
- data/lib/rmagick/version.rb +3 -1
- data/lib/rmagick.rb +2 -0
- data/lib/rmagick_internal.rb +8 -48
- data/rmagick.gemspec +3 -1
- metadata +17 -4
- data/deprecated/RMagick.rb +0 -6
data/ext/RMagick/rmilist.c
CHANGED
@@ -20,7 +20,39 @@ static void imagelist_push(VALUE, VALUE);
|
|
20
20
|
static VALUE ImageList_new(void);
|
21
21
|
|
22
22
|
|
23
|
+
DEFINE_GVL_STUB3(AppendImages, const Image *, const MagickBooleanType, ExceptionInfo *);
|
24
|
+
DEFINE_GVL_STUB5(CloneImage, const Image *, const size_t, const size_t, const MagickBooleanType, ExceptionInfo *);
|
25
|
+
DEFINE_GVL_STUB2(CloneImageList, const Image *, ExceptionInfo *);
|
26
|
+
DEFINE_GVL_STUB2(CoalesceImages, const Image *, ExceptionInfo *);
|
27
|
+
DEFINE_GVL_STUB2(DisposeImages, const Image *, ExceptionInfo *);
|
28
|
+
DEFINE_GVL_STUB3(EvaluateImages, const Image *, const MagickEvaluateOperator, ExceptionInfo *);
|
29
|
+
DEFINE_GVL_STUB4(ImagesToBlob, const ImageInfo *, Image *, size_t *, ExceptionInfo *);
|
30
|
+
DEFINE_GVL_STUB3(MergeImageLayers, Image *, const LayerMethod, ExceptionInfo *);
|
31
|
+
DEFINE_GVL_STUB3(MontageImages, const Image *, const MontageInfo *, ExceptionInfo *);
|
32
|
+
DEFINE_GVL_STUB3(MorphImages, const Image *, const size_t, ExceptionInfo *);
|
33
|
+
DEFINE_GVL_STUB2(OptimizeImageLayers, const Image *, ExceptionInfo *);
|
34
|
+
DEFINE_GVL_STUB2(OptimizePlusImageLayers, const Image *, ExceptionInfo *);
|
35
|
+
#if defined(IMAGEMAGICK_7)
|
36
|
+
DEFINE_GVL_STUB3(AnimateImages, const ImageInfo *, Image *, ExceptionInfo *);
|
37
|
+
DEFINE_GVL_STUB3(CombineImages, const Image *, const ColorspaceType, ExceptionInfo *);
|
38
|
+
DEFINE_GVL_STUB3(CompareImagesLayers, const Image *, const LayerMethod, ExceptionInfo *);
|
39
|
+
DEFINE_GVL_STUB3(QuantizeImages, const QuantizeInfo *, Image *, ExceptionInfo *);
|
40
|
+
DEFINE_GVL_STUB4(RemapImages, const QuantizeInfo *, Image *, const Image *, ExceptionInfo *);
|
41
|
+
DEFINE_GVL_STUB3(WriteImage, const ImageInfo *, Image *, ExceptionInfo *);
|
42
|
+
#else
|
43
|
+
DEFINE_GVL_STUB2(AnimateImages, const ImageInfo *, Image *);
|
44
|
+
DEFINE_GVL_STUB3(CombineImages, const Image *, const ChannelType, ExceptionInfo *);
|
45
|
+
DEFINE_GVL_STUB3(CompareImageLayers, const Image *, const ImageLayerMethod, ExceptionInfo *);
|
46
|
+
DEFINE_GVL_STUB2(DeconstructImages, const Image *, ExceptionInfo *);
|
47
|
+
DEFINE_GVL_STUB2(QuantizeImages, const QuantizeInfo *, Image *);
|
48
|
+
DEFINE_GVL_STUB3(RemapImages, const QuantizeInfo *, Image *, const Image *);
|
49
|
+
DEFINE_GVL_STUB2(WriteImage, const ImageInfo *, Image *);
|
50
|
+
#endif
|
23
51
|
|
52
|
+
DEFINE_GVL_VOID_STUB6(CompositeLayers, Image *, const CompositeOperator, Image *, const ssize_t, const ssize_t, ExceptionInfo *);
|
53
|
+
DEFINE_GVL_VOID_STUB2(OptimizeImageTransparency, const Image *, ExceptionInfo *);
|
54
|
+
DEFINE_GVL_VOID_STUB2(RemoveDuplicateLayers, Image **, ExceptionInfo *);
|
55
|
+
DEFINE_GVL_VOID_STUB2(RemoveZeroDelayLayers, Image **, ExceptionInfo *);
|
24
56
|
|
25
57
|
|
26
58
|
/**
|
@@ -72,15 +104,17 @@ ImageList_animate(int argc, VALUE *argv, VALUE self)
|
|
72
104
|
}
|
73
105
|
}
|
74
106
|
|
75
|
-
|
107
|
+
TypedData_Get_Struct(info_obj, Info, &rm_info_data_type, info);
|
76
108
|
#if defined(IMAGEMAGICK_7)
|
77
109
|
exception = AcquireExceptionInfo();
|
78
|
-
AnimateImages
|
110
|
+
GVL_STRUCT_TYPE(AnimateImages) args = { info, images, exception };
|
111
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(AnimateImages), &args);
|
79
112
|
rm_split(images);
|
80
113
|
CHECK_EXCEPTION();
|
81
114
|
DestroyExceptionInfo(exception);
|
82
115
|
#else
|
83
|
-
AnimateImages
|
116
|
+
GVL_STRUCT_TYPE(AnimateImages) args = { info, images };
|
117
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(AnimateImages), &args);
|
84
118
|
rm_split(images);
|
85
119
|
rm_check_image_exception(images, RetainOnError);
|
86
120
|
#endif
|
@@ -112,7 +146,8 @@ ImageList_append(VALUE self, VALUE stack_arg)
|
|
112
146
|
stack = RTEST(stack_arg);
|
113
147
|
|
114
148
|
exception = AcquireExceptionInfo();
|
115
|
-
|
149
|
+
GVL_STRUCT_TYPE(AppendImages) args = { images, stack, exception };
|
150
|
+
new_image = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(AppendImages), &args);
|
116
151
|
rm_split(images);
|
117
152
|
rm_check_exception(exception, new_image, DestroyOnError);
|
118
153
|
DestroyExceptionInfo(exception);
|
@@ -136,8 +171,8 @@ ImageList_average(VALUE self)
|
|
136
171
|
images = images_from_imagelist(self);
|
137
172
|
|
138
173
|
exception = AcquireExceptionInfo();
|
139
|
-
|
140
|
-
|
174
|
+
GVL_STRUCT_TYPE(EvaluateImages) args = { images, MeanEvaluateOperator, exception };
|
175
|
+
new_image = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(EvaluateImages), &args);
|
141
176
|
rm_split(images);
|
142
177
|
rm_check_exception(exception, new_image, DestroyOnError);
|
143
178
|
DestroyExceptionInfo(exception);
|
@@ -164,7 +199,8 @@ ImageList_coalesce(VALUE self)
|
|
164
199
|
images = images_from_imagelist(self);
|
165
200
|
|
166
201
|
exception = AcquireExceptionInfo();
|
167
|
-
|
202
|
+
GVL_STRUCT_TYPE(CoalesceImages) args = { images, exception };
|
203
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(CoalesceImages), &args);
|
168
204
|
rm_split(images);
|
169
205
|
rm_check_exception(exception, new_images, DestroyOnError);
|
170
206
|
DestroyExceptionInfo(exception);
|
@@ -252,10 +288,11 @@ VALUE ImageList_combine(int argc, VALUE *argv, VALUE self)
|
|
252
288
|
#if defined(IMAGEMAGICK_6)
|
253
289
|
old_colorspace = images->colorspace;
|
254
290
|
SetImageColorspace(images, colorspace);
|
255
|
-
|
291
|
+
GVL_STRUCT_TYPE(CombineImages) args = { images, channel, exception };
|
256
292
|
#else
|
257
|
-
|
293
|
+
GVL_STRUCT_TYPE(CombineImages) args = { images, colorspace, exception };
|
258
294
|
#endif
|
295
|
+
new_image = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(CombineImages), &args);
|
259
296
|
|
260
297
|
rm_split(images);
|
261
298
|
#if defined(IMAGEMAGICK_6)
|
@@ -319,7 +356,8 @@ ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
|
|
319
356
|
new_images->gravity, &geometry);
|
320
357
|
|
321
358
|
exception = AcquireExceptionInfo();
|
322
|
-
CompositeLayers
|
359
|
+
GVL_STRUCT_TYPE(CompositeLayers) args = { new_images, operator, source, geometry.x, geometry.y, exception };
|
360
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(CompositeLayers), &args);
|
323
361
|
rm_split(source);
|
324
362
|
rm_check_exception(exception, new_images, DestroyOnError);
|
325
363
|
DestroyExceptionInfo(exception);
|
@@ -345,9 +383,11 @@ ImageList_deconstruct(VALUE self)
|
|
345
383
|
images = images_from_imagelist(self);
|
346
384
|
exception = AcquireExceptionInfo();
|
347
385
|
#if defined(IMAGEMAGICK_7)
|
348
|
-
|
386
|
+
GVL_STRUCT_TYPE(CompareImagesLayers) args = { images, CompareAnyLayer, exception };
|
387
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(CompareImagesLayers), &args);
|
349
388
|
#else
|
350
|
-
|
389
|
+
GVL_STRUCT_TYPE(DeconstructImages) args = { images, exception };
|
390
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(DeconstructImages), &args);
|
351
391
|
#endif
|
352
392
|
rm_split(images);
|
353
393
|
rm_check_exception(exception, new_images, DestroyOnError);
|
@@ -374,7 +414,7 @@ ImageList_display(VALUE self)
|
|
374
414
|
|
375
415
|
// Create a new Info object to use with this call
|
376
416
|
info_obj = rm_info_new();
|
377
|
-
|
417
|
+
TypedData_Get_Struct(info_obj, Info, &rm_info_data_type, info);
|
378
418
|
|
379
419
|
// Convert the images array to an images sequence.
|
380
420
|
images = images_from_imagelist(self);
|
@@ -410,7 +450,8 @@ ImageList_flatten_images(VALUE self)
|
|
410
450
|
images = images_from_imagelist(self);
|
411
451
|
exception = AcquireExceptionInfo();
|
412
452
|
|
413
|
-
|
453
|
+
GVL_STRUCT_TYPE(MergeImageLayers) args = { images, FlattenLayer, exception };
|
454
|
+
new_image = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(MergeImageLayers), &args);
|
414
455
|
|
415
456
|
rm_split(images);
|
416
457
|
rm_check_exception(exception, new_image, DestroyOnError);
|
@@ -429,7 +470,7 @@ ImageList_flatten_images(VALUE self)
|
|
429
470
|
* Creates {Magick::ImageList::Montage} object, yields to block
|
430
471
|
* if present in {Magick::ImageList::Montage} object's scope.
|
431
472
|
* @yield [Magick::ImageList::Montage]
|
432
|
-
*
|
473
|
+
*
|
433
474
|
* @return [Magick::ImageList] a new image list
|
434
475
|
*/
|
435
476
|
VALUE
|
@@ -444,20 +485,10 @@ ImageList_montage(VALUE self)
|
|
444
485
|
montage_obj = rm_montage_new();
|
445
486
|
if (rb_block_given_p())
|
446
487
|
{
|
447
|
-
|
448
|
-
// object's attributes.
|
449
|
-
if (rb_proc_arity(rb_block_proc()) == 0)
|
450
|
-
{
|
451
|
-
rb_warn("passing a block without an image argument is deprecated");
|
452
|
-
rb_obj_instance_eval(0, NULL, montage_obj);
|
453
|
-
}
|
454
|
-
else
|
455
|
-
{
|
456
|
-
rb_yield(montage_obj);
|
457
|
-
}
|
488
|
+
rb_yield(montage_obj);
|
458
489
|
}
|
459
490
|
|
460
|
-
|
491
|
+
TypedData_Get_Struct(montage_obj, Montage, &rm_montage_data_type, montage);
|
461
492
|
|
462
493
|
images = images_from_imagelist(self);
|
463
494
|
|
@@ -476,7 +507,8 @@ ImageList_montage(VALUE self)
|
|
476
507
|
exception = AcquireExceptionInfo();
|
477
508
|
|
478
509
|
// MontageImage can return more than one image.
|
479
|
-
|
510
|
+
GVL_STRUCT_TYPE(MontageImages) args = { images, montage->info, exception };
|
511
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(MontageImages), &args);
|
480
512
|
rm_split(images);
|
481
513
|
rm_check_exception(exception, new_images, DestroyOnError);
|
482
514
|
DestroyExceptionInfo(exception);
|
@@ -512,7 +544,8 @@ ImageList_morph(VALUE self, VALUE nimages)
|
|
512
544
|
|
513
545
|
images = images_from_imagelist(self);
|
514
546
|
exception = AcquireExceptionInfo();
|
515
|
-
|
547
|
+
GVL_STRUCT_TYPE(MorphImages) args = { images, number_images, exception };
|
548
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(MorphImages), &args);
|
516
549
|
rm_split(images);
|
517
550
|
rm_check_exception(exception, new_images, DestroyOnError);
|
518
551
|
DestroyExceptionInfo(exception);
|
@@ -535,7 +568,8 @@ ImageList_mosaic(VALUE self)
|
|
535
568
|
images = images_from_imagelist(self);
|
536
569
|
|
537
570
|
exception = AcquireExceptionInfo();
|
538
|
-
|
571
|
+
GVL_STRUCT_TYPE(MergeImageLayers) args = { images, MosaicLayer, exception };
|
572
|
+
new_image = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(MergeImageLayers), &args);
|
539
573
|
|
540
574
|
rm_split(images);
|
541
575
|
rm_check_exception(exception, new_image, DestroyOnError);
|
@@ -569,22 +603,37 @@ ImageList_optimize_layers(VALUE self, VALUE method)
|
|
569
603
|
switch (mthd)
|
570
604
|
{
|
571
605
|
case CoalesceLayer:
|
572
|
-
|
606
|
+
{
|
607
|
+
GVL_STRUCT_TYPE(CoalesceImages) args = { images, exception };
|
608
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(CoalesceImages), &args);
|
609
|
+
}
|
573
610
|
break;
|
574
611
|
case DisposeLayer:
|
575
|
-
|
612
|
+
{
|
613
|
+
GVL_STRUCT_TYPE(DisposeImages) args = { images, exception };
|
614
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(DisposeImages), &args);
|
615
|
+
}
|
576
616
|
break;
|
577
617
|
case OptimizeTransLayer:
|
578
|
-
|
579
|
-
|
618
|
+
{
|
619
|
+
new_images = clone_imagelist(images);
|
620
|
+
GVL_STRUCT_TYPE(OptimizeImageTransparency) args = { new_images, exception };
|
621
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(OptimizeImageTransparency), &args);
|
622
|
+
}
|
580
623
|
break;
|
581
624
|
case RemoveDupsLayer:
|
582
|
-
|
583
|
-
|
625
|
+
{
|
626
|
+
new_images = clone_imagelist(images);
|
627
|
+
GVL_STRUCT_TYPE(RemoveDuplicateLayers) args = { &new_images, exception };
|
628
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(RemoveDuplicateLayers), &args);
|
629
|
+
}
|
584
630
|
break;
|
585
631
|
case RemoveZeroLayer:
|
586
|
-
|
587
|
-
|
632
|
+
{
|
633
|
+
new_images = clone_imagelist(images);
|
634
|
+
GVL_STRUCT_TYPE(RemoveZeroDelayLayers) args = { &new_images, exception };
|
635
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(RemoveZeroDelayLayers), &args);
|
636
|
+
}
|
588
637
|
break;
|
589
638
|
case CompositeLayer:
|
590
639
|
rm_split(images);
|
@@ -593,50 +642,81 @@ ImageList_optimize_layers(VALUE self, VALUE method)
|
|
593
642
|
break;
|
594
643
|
// In 6.3.4-ish, OptimizeImageLayer replaced OptimizeLayer
|
595
644
|
case OptimizeImageLayer:
|
596
|
-
|
645
|
+
{
|
646
|
+
GVL_STRUCT_TYPE(OptimizeImageLayers) args = { images, exception };
|
647
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(OptimizeImageLayers), &args);
|
648
|
+
}
|
597
649
|
break;
|
598
650
|
// and OptimizeLayer became a "General Purpose, GIF Animation Optimizer" (ref. mogrify.c)
|
599
651
|
case OptimizeLayer:
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
652
|
+
{
|
653
|
+
GVL_STRUCT_TYPE(CoalesceImages) args_CoalesceImages = { images, exception };
|
654
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(CoalesceImages), &args_CoalesceImages);
|
655
|
+
rm_split(images);
|
656
|
+
rm_check_exception(exception, new_images, DestroyOnError);
|
657
|
+
|
658
|
+
GVL_STRUCT_TYPE(OptimizeImageLayers) args_OptimizeImageLayers = { new_images, exception };
|
659
|
+
new_images2 = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(OptimizeImageLayers), &args_OptimizeImageLayers);
|
660
|
+
DestroyImageList(new_images);
|
661
|
+
rm_check_exception(exception, new_images2, DestroyOnError);
|
662
|
+
|
663
|
+
new_images = new_images2;
|
664
|
+
GVL_STRUCT_TYPE(OptimizeImageTransparency) args_OptimizeImageTransparency = { new_images, exception };
|
665
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(OptimizeImageTransparency), &args_OptimizeImageTransparency);
|
666
|
+
rm_check_exception(exception, new_images, DestroyOnError);
|
667
|
+
// mogrify supports -dither here. We don't.
|
668
|
+
GetQuantizeInfo(&quantize_info);
|
611
669
|
#if defined(IMAGEMAGICK_7)
|
612
|
-
|
670
|
+
GVL_STRUCT_TYPE(RemapImages) args_RemapImages = { &quantize_info, new_images, NULL, exception };
|
613
671
|
#else
|
614
|
-
|
672
|
+
GVL_STRUCT_TYPE(RemapImages) args_RemapImages = { &quantize_info, new_images, NULL };
|
615
673
|
#endif
|
674
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(RemapImages), &args_RemapImages);
|
675
|
+
|
676
|
+
}
|
616
677
|
break;
|
617
678
|
case OptimizePlusLayer:
|
618
|
-
|
679
|
+
{
|
680
|
+
GVL_STRUCT_TYPE(OptimizePlusImageLayers) args = { images, exception };
|
681
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(OptimizePlusImageLayers), &args);
|
682
|
+
}
|
619
683
|
break;
|
620
684
|
case CompareAnyLayer:
|
621
685
|
case CompareClearLayer:
|
622
686
|
case CompareOverlayLayer:
|
687
|
+
{
|
623
688
|
#if defined(IMAGEMAGICK_7)
|
624
|
-
|
689
|
+
GVL_STRUCT_TYPE(CompareImagesLayers) args = { images, mthd, exception };
|
690
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(CompareImagesLayers), &args);
|
625
691
|
#else
|
626
|
-
|
692
|
+
GVL_STRUCT_TYPE(CompareImageLayers) args = { images, mthd, exception };
|
693
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(CompareImageLayers), &args);
|
627
694
|
#endif
|
695
|
+
}
|
628
696
|
break;
|
629
697
|
case MosaicLayer:
|
630
|
-
|
698
|
+
{
|
699
|
+
GVL_STRUCT_TYPE(MergeImageLayers) args = { images, mthd, exception };
|
700
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(MergeImageLayers), &args);
|
701
|
+
}
|
631
702
|
break;
|
632
703
|
case FlattenLayer:
|
633
|
-
|
704
|
+
{
|
705
|
+
GVL_STRUCT_TYPE(MergeImageLayers) args = { images, mthd, exception };
|
706
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(MergeImageLayers), &args);
|
707
|
+
}
|
634
708
|
break;
|
635
709
|
case MergeLayer:
|
636
|
-
|
710
|
+
{
|
711
|
+
GVL_STRUCT_TYPE(MergeImageLayers) args = { images, mthd, exception };
|
712
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(MergeImageLayers), &args);
|
713
|
+
}
|
637
714
|
break;
|
638
715
|
case TrimBoundsLayer:
|
639
|
-
|
716
|
+
{
|
717
|
+
GVL_STRUCT_TYPE(MergeImageLayers) args = { images, mthd, exception };
|
718
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(MergeImageLayers), &args);
|
719
|
+
}
|
640
720
|
break;
|
641
721
|
default:
|
642
722
|
rm_split(images);
|
@@ -834,7 +914,8 @@ clone_imagelist(Image *images)
|
|
834
914
|
{
|
835
915
|
Image *clone;
|
836
916
|
|
837
|
-
|
917
|
+
GVL_STRUCT_TYPE(CloneImage) args = { image, 0, 0, MagickTrue, exception };
|
918
|
+
clone = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(CloneImage), &args);
|
838
919
|
rm_check_exception(exception, new_imagelist, DestroyOnError);
|
839
920
|
AppendImageToList(&new_imagelist, clone);
|
840
921
|
image = GetNextImageInList(image);
|
@@ -911,17 +992,19 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
|
|
911
992
|
// Convert image array to image sequence, clone image sequence.
|
912
993
|
images = images_from_imagelist(self);
|
913
994
|
exception = AcquireExceptionInfo();
|
914
|
-
|
995
|
+
GVL_STRUCT_TYPE(CloneImageList) args_CloneImageList = { images, exception };
|
996
|
+
new_images = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(CloneImageList), &args_CloneImageList);
|
915
997
|
rm_split(images);
|
916
998
|
rm_check_exception(exception, new_images, DestroyOnError);
|
917
999
|
|
918
1000
|
rm_ensure_result(new_images);
|
919
1001
|
|
920
1002
|
#if defined(IMAGEMAGICK_7)
|
921
|
-
QuantizeImages
|
1003
|
+
GVL_STRUCT_TYPE(QuantizeImages) args_QuantizeImages = { &quantize_info, new_images, exception };
|
922
1004
|
#else
|
923
|
-
QuantizeImages
|
1005
|
+
GVL_STRUCT_TYPE(QuantizeImages) args_QuantizeImages = { &quantize_info, new_images };
|
924
1006
|
#endif
|
1007
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(QuantizeImages), &args_QuantizeImages);
|
925
1008
|
rm_check_exception(exception, new_images, DestroyOnError);
|
926
1009
|
DestroyExceptionInfo(exception);
|
927
1010
|
|
@@ -988,12 +1071,14 @@ ImageList_remap(int argc, VALUE *argv, VALUE self)
|
|
988
1071
|
|
989
1072
|
#if defined(IMAGEMAGICK_7)
|
990
1073
|
exception = AcquireExceptionInfo();
|
991
|
-
RemapImages
|
1074
|
+
GVL_STRUCT_TYPE(RemapImages) args = { &quantize_info, images, remap_image, exception };
|
1075
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(RemapImages), &args);
|
992
1076
|
rm_split(images);
|
993
1077
|
CHECK_EXCEPTION();
|
994
1078
|
DestroyExceptionInfo(exception);
|
995
1079
|
#else
|
996
|
-
RemapImages
|
1080
|
+
GVL_STRUCT_TYPE(RemapImages) args = { &quantize_info, images, remap_image };
|
1081
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(RemapImages), &args);
|
997
1082
|
rm_split(images);
|
998
1083
|
rm_check_image_exception(images, RetainOnError);
|
999
1084
|
#endif
|
@@ -1025,7 +1110,7 @@ ImageList_to_blob(VALUE self)
|
|
1025
1110
|
ExceptionInfo *exception;
|
1026
1111
|
|
1027
1112
|
info_obj = rm_info_new();
|
1028
|
-
|
1113
|
+
TypedData_Get_Struct(info_obj, Info, &rm_info_data_type, info);
|
1029
1114
|
|
1030
1115
|
// Convert the images array to an images sequence.
|
1031
1116
|
images = images_from_imagelist(self);
|
@@ -1052,7 +1137,8 @@ ImageList_to_blob(VALUE self)
|
|
1052
1137
|
// can happen is that there's only one image or the format
|
1053
1138
|
// doesn't support multi-image files.
|
1054
1139
|
info->adjoin = MagickTrue;
|
1055
|
-
|
1140
|
+
GVL_STRUCT_TYPE(ImagesToBlob) args = { info, images, &length, exception };
|
1141
|
+
blob = CALL_FUNC_WITHOUT_GVL(GVL_FUNC(ImagesToBlob), &args);
|
1056
1142
|
if (blob && exception->severity >= ErrorException)
|
1057
1143
|
{
|
1058
1144
|
magick_free((void*)blob);
|
@@ -1098,7 +1184,7 @@ ImageList_write(VALUE self, VALUE file)
|
|
1098
1184
|
ExceptionInfo *exception;
|
1099
1185
|
|
1100
1186
|
info_obj = rm_info_new();
|
1101
|
-
|
1187
|
+
TypedData_Get_Struct(info_obj, Info, &rm_info_data_type, info);
|
1102
1188
|
|
1103
1189
|
|
1104
1190
|
if (TYPE(file) == T_FILE)
|
@@ -1152,10 +1238,12 @@ ImageList_write(VALUE self, VALUE file)
|
|
1152
1238
|
{
|
1153
1239
|
rm_sync_image_options(img, info);
|
1154
1240
|
#if defined(IMAGEMAGICK_7)
|
1155
|
-
WriteImage
|
1241
|
+
GVL_STRUCT_TYPE(WriteImage) args = { info, img, exception };
|
1242
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(WriteImage), &args);
|
1156
1243
|
rm_check_exception(exception, img, RetainOnError);
|
1157
1244
|
#else
|
1158
|
-
WriteImage
|
1245
|
+
GVL_STRUCT_TYPE(WriteImage) args = { info, img };
|
1246
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(WriteImage), &args);
|
1159
1247
|
// images will be split before raising an exception
|
1160
1248
|
rm_check_image_exception(images, RetainOnError);
|
1161
1249
|
#endif
|