rmagick 2.13.3 → 2.13.4

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.

Files changed (54) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +21 -0
  3. data/.travis.yml +57 -0
  4. data/CONTRIBUTING.md +22 -0
  5. data/ChangeLog +47 -4
  6. data/Gemfile +7 -0
  7. data/{README.rc → README.textile} +34 -104
  8. data/Rakefile +160 -24
  9. data/before_install_linux.sh +12 -0
  10. data/before_install_osx.sh +2 -0
  11. data/doc/.cvsignore +1 -0
  12. data/doc/ex/images/image_with_profile.jpg +0 -0
  13. data/doc/ex/mask.rb +1 -1
  14. data/examples/identify.rb +1 -1
  15. data/ext/RMagick/extconf.rb +60 -23
  16. data/ext/RMagick/rmagick.c +15 -15
  17. data/ext/RMagick/rmagick.h +9 -7
  18. data/ext/RMagick/rmdraw.c +12 -12
  19. data/ext/RMagick/rmenum.c +2 -2
  20. data/ext/RMagick/rmfill.c +25 -25
  21. data/ext/RMagick/rmilist.c +121 -104
  22. data/ext/RMagick/rmimage.c +737 -546
  23. data/ext/RMagick/rminfo.c +15 -15
  24. data/ext/RMagick/rmmain.c +27 -3
  25. data/ext/RMagick/rmpixel.c +25 -27
  26. data/ext/RMagick/rmstruct.c +1 -1
  27. data/ext/RMagick/rmutil.c +18 -18
  28. data/lib/RMagick.rb +1 -1962
  29. data/lib/rmagick.rb +1 -0
  30. data/lib/rmagick/version.rb +3 -1
  31. data/lib/rmagick_internal.rb +1964 -0
  32. data/rmagick.gemspec +14 -5
  33. data/test/Image2.rb +7 -3
  34. data/test/Image3.rb +54 -23
  35. data/test/ImageList2.rb +1 -1
  36. data/test/Image_attributes.rb +27 -10
  37. data/test/Import_Export.rb +11 -1
  38. data/test/Info.rb +4 -4
  39. data/test/Magick.rb +14 -54
  40. data/test/Pixel.rb +3 -4
  41. data/test/{all_basic.rb → test_all_basic.rb} +9 -17
  42. data/test/tmpnam_test.rb +50 -0
  43. metadata +50 -21
  44. data/README +0 -15
  45. data/README-Mac-OSX.txt +0 -1
  46. data/build_tarball.rake +0 -215
  47. data/lib/rvg/to_c.rb +0 -103
  48. data/metaconfig +0 -7
  49. data/pkg/rmagick-2.13.3.rc1.gem +0 -0
  50. data/post-clean.rb +0 -12
  51. data/post-install.rb +0 -50
  52. data/post-setup.rb +0 -254
  53. data/setup.rb +0 -1585
  54. data/uninstall.rb +0 -76
@@ -93,7 +93,7 @@ ImageList_append(VALUE self, VALUE stack_arg)
93
93
  {
94
94
  Image *images, *new_image;
95
95
  unsigned int stack;
96
- ExceptionInfo exception;
96
+ ExceptionInfo *exception;
97
97
 
98
98
  // Convert the image array to an image sequence.
99
99
  images = images_from_imagelist(self);
@@ -102,11 +102,11 @@ ImageList_append(VALUE self, VALUE stack_arg)
102
102
  // otherwise left-to-right.
103
103
  stack = RTEST(stack_arg);
104
104
 
105
- GetExceptionInfo(&exception);
106
- new_image = AppendImages(images, stack, &exception);
105
+ exception = AcquireExceptionInfo();
106
+ new_image = AppendImages(images, stack, exception);
107
107
  rm_split(images);
108
- rm_check_exception(&exception, new_image, DestroyOnError);
109
- (void) DestroyExceptionInfo(&exception);
108
+ rm_check_exception(exception, new_image, DestroyOnError);
109
+ (void) DestroyExceptionInfo(exception);
110
110
 
111
111
  rm_ensure_result(new_image);
112
112
 
@@ -127,16 +127,21 @@ VALUE
127
127
  ImageList_average(VALUE self)
128
128
  {
129
129
  Image *images, *new_image;
130
- ExceptionInfo exception;
130
+ ExceptionInfo *exception;
131
131
 
132
132
  // Convert the images array to an images sequence.
133
133
  images = images_from_imagelist(self);
134
134
 
135
- GetExceptionInfo(&exception);
136
- new_image = AverageImages(images, &exception);
135
+ exception = AcquireExceptionInfo();
136
+ #if defined(HAVE_EVALUATEIMAGES)
137
+ new_image = EvaluateImages(images, MeanEvaluateOperator, exception);
138
+ #else
139
+ new_image = AverageImages(images, exception);
140
+ #endif
141
+
137
142
  rm_split(images);
138
- rm_check_exception(&exception, new_image, DestroyOnError);
139
- (void) DestroyExceptionInfo(&exception);
143
+ rm_check_exception(exception, new_image, DestroyOnError);
144
+ (void) DestroyExceptionInfo(exception);
140
145
 
141
146
  rm_ensure_result(new_image);
142
147
 
@@ -161,16 +166,16 @@ VALUE
161
166
  ImageList_coalesce(VALUE self)
162
167
  {
163
168
  Image *images, *new_images;
164
- ExceptionInfo exception;
169
+ ExceptionInfo *exception;
165
170
 
166
171
  // Convert the image array to an image sequence.
167
172
  images = images_from_imagelist(self);
168
173
 
169
- GetExceptionInfo(&exception);
170
- new_images = CoalesceImages(images, &exception);
174
+ exception = AcquireExceptionInfo();
175
+ new_images = CoalesceImages(images, exception);
171
176
  rm_split(images);
172
- rm_check_exception(&exception, new_images, DestroyOnError);
173
- (void) DestroyExceptionInfo(&exception);
177
+ rm_check_exception(exception, new_images, DestroyOnError);
178
+ (void) DestroyExceptionInfo(exception);
174
179
 
175
180
  rm_ensure_result(new_images);
176
181
 
@@ -201,7 +206,7 @@ ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
201
206
  Image *dest, *source, *new_images;
202
207
  RectangleInfo geometry;
203
208
  CompositeOperator operator = OverCompositeOp;
204
- ExceptionInfo exception;
209
+ ExceptionInfo *exception;
205
210
 
206
211
  switch (argc)
207
212
  {
@@ -231,11 +236,11 @@ ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
231
236
  , new_images->page.height != 0 ? new_images->page.height : new_images->rows
232
237
  , new_images->gravity, &geometry);
233
238
 
234
- GetExceptionInfo(&exception);
235
- CompositeLayers(new_images, operator, source, geometry.x, geometry.y, &exception);
239
+ exception = AcquireExceptionInfo();
240
+ CompositeLayers(new_images, operator, source, geometry.x, geometry.y, exception);
236
241
  rm_split(source);
237
- rm_check_exception(&exception, new_images, DestroyOnError);
238
- (void) DestroyExceptionInfo(&exception);
242
+ rm_check_exception(exception, new_images, DestroyOnError);
243
+ (void) DestroyExceptionInfo(exception);
239
244
 
240
245
  return rm_imagelist_from_images(new_images);
241
246
  }
@@ -255,14 +260,14 @@ VALUE
255
260
  ImageList_deconstruct(VALUE self)
256
261
  {
257
262
  Image *new_images, *images;
258
- ExceptionInfo exception;
263
+ ExceptionInfo *exception;
259
264
 
260
265
  images = images_from_imagelist(self);
261
- GetExceptionInfo(&exception);
262
- new_images = DeconstructImages(images, &exception);
266
+ exception = AcquireExceptionInfo();
267
+ new_images = DeconstructImages(images, exception);
263
268
  rm_split(images);
264
- rm_check_exception(&exception, new_images, DestroyOnError);
265
- (void) DestroyExceptionInfo(&exception);
269
+ rm_check_exception(exception, new_images, DestroyOnError);
270
+ (void) DestroyExceptionInfo(exception);
266
271
 
267
272
  rm_ensure_result(new_images);
268
273
 
@@ -317,20 +322,20 @@ VALUE
317
322
  ImageList_flatten_images(VALUE self)
318
323
  {
319
324
  Image *images, *new_image;
320
- ExceptionInfo exception;
325
+ ExceptionInfo *exception;
321
326
 
322
327
  images = images_from_imagelist(self);
323
- GetExceptionInfo(&exception);
328
+ exception = AcquireExceptionInfo();
324
329
 
325
330
  #if defined(HAVE_ENUM_FLATTENLAYER)
326
- new_image = MergeImageLayers(images, FlattenLayer, &exception);
331
+ new_image = MergeImageLayers(images, FlattenLayer, exception);
327
332
  #else
328
- new_image = FlattenImages(images, &exception);
333
+ new_image = FlattenImages(images, exception);
329
334
  #endif
330
335
 
331
336
  rm_split(images);
332
- rm_check_exception(&exception, new_image, DestroyOnError);
333
- (void) DestroyExceptionInfo(&exception);
337
+ rm_check_exception(exception, new_image, DestroyOnError);
338
+ (void) DestroyExceptionInfo(exception);
334
339
 
335
340
  rm_ensure_result(new_image);
336
341
 
@@ -360,7 +365,7 @@ ImageList_fx(int argc, VALUE *argv, VALUE self)
360
365
  Image *images, *new_image;
361
366
  char *expression;
362
367
  ChannelType channels;
363
- ExceptionInfo exception;
368
+ ExceptionInfo *exception;
364
369
 
365
370
 
366
371
  channels = extract_channels(&argc, argv);
@@ -378,11 +383,11 @@ ImageList_fx(int argc, VALUE *argv, VALUE self)
378
383
  expression = StringValuePtr(argv[0]);
379
384
 
380
385
  images = images_from_imagelist(self);
381
- GetExceptionInfo(&exception);
382
- new_image = FxImageChannel(images, channels, expression, &exception);
386
+ exception = AcquireExceptionInfo();
387
+ new_image = FxImageChannel(images, channels, expression, exception);
383
388
  rm_split(images);
384
- rm_check_exception(&exception, new_image, DestroyOnError);
385
- (void) DestroyExceptionInfo(&exception);
389
+ rm_check_exception(exception, new_image, DestroyOnError);
390
+ (void) DestroyExceptionInfo(exception);
386
391
 
387
392
  rm_ensure_result(new_image);
388
393
 
@@ -413,9 +418,10 @@ ImageList_map(int argc, VALUE *argv, VALUE self)
413
418
  Image *map;
414
419
  unsigned int dither = MagickFalse;
415
420
  volatile VALUE scene, new_imagelist, t;
416
- ExceptionInfo exception;
421
+ ExceptionInfo *exception;
417
422
 
418
423
  #if defined(HAVE_REMAPIMAGES)
424
+ QuantizeInfo quantize_info;
419
425
  rb_warning("ImageList#map is deprecated. Use ImageList#remap instead.");
420
426
  #endif
421
427
 
@@ -434,18 +440,24 @@ ImageList_map(int argc, VALUE *argv, VALUE self)
434
440
 
435
441
 
436
442
  // Convert image array to image sequence, clone image sequence.
437
- GetExceptionInfo(&exception);
443
+ exception = AcquireExceptionInfo();
438
444
 
439
445
  images = images_from_imagelist(self);
440
- new_images = CloneImageList(images, &exception);
446
+ new_images = CloneImageList(images, exception);
441
447
  rm_split(images);
442
- rm_check_exception(&exception, new_images, DestroyOnError);
443
- (void) DestroyExceptionInfo(&exception);
448
+ rm_check_exception(exception, new_images, DestroyOnError);
449
+ (void) DestroyExceptionInfo(exception);
444
450
 
445
451
  rm_ensure_result(new_images);
446
452
 
447
453
  // Call ImageMagick
454
+ #if defined(HAVE_REMAPIMAGES)
455
+ GetQuantizeInfo(&quantize_info);
456
+ quantize_info.dither = dither;
457
+ (void) RemapImages(&quantize_info, new_images, map);
458
+ #else
448
459
  (void) MapImages(new_images, map, dither);
460
+ #endif
449
461
  rm_check_image_exception(new_images, DestroyOnError);
450
462
 
451
463
  // Set @scene in new ImageList object to same value as in self.
@@ -476,7 +488,7 @@ ImageList_montage(VALUE self)
476
488
  volatile VALUE montage_obj;
477
489
  Montage *montage;
478
490
  Image *new_images, *images;
479
- ExceptionInfo exception;
491
+ ExceptionInfo *exception;
480
492
 
481
493
  // Create a new instance of the Magick::Montage class
482
494
  montage_obj = rm_montage_new();
@@ -501,13 +513,13 @@ ImageList_montage(VALUE self)
501
513
  }
502
514
  }
503
515
 
504
- GetExceptionInfo(&exception);
516
+ exception = AcquireExceptionInfo();
505
517
 
506
518
  // MontageImage can return more than one image.
507
- new_images = MontageImages(images, montage->info, &exception);
519
+ new_images = MontageImages(images, montage->info, exception);
508
520
  rm_split(images);
509
- rm_check_exception(&exception, new_images, DestroyOnError);
510
- (void) DestroyExceptionInfo(&exception);
521
+ rm_check_exception(exception, new_images, DestroyOnError);
522
+ (void) DestroyExceptionInfo(exception);
511
523
 
512
524
  rm_ensure_result(new_images);
513
525
 
@@ -533,7 +545,7 @@ VALUE
533
545
  ImageList_morph(VALUE self, VALUE nimages)
534
546
  {
535
547
  Image *images, *new_images;
536
- ExceptionInfo exception;
548
+ ExceptionInfo *exception;
537
549
  long number_images;
538
550
 
539
551
 
@@ -544,12 +556,12 @@ ImageList_morph(VALUE self, VALUE nimages)
544
556
  rb_raise(rb_eArgError, "number of intervening images must be > 0");
545
557
  }
546
558
 
547
- GetExceptionInfo(&exception);
559
+ exception = AcquireExceptionInfo();
548
560
  images = images_from_imagelist(self);
549
- new_images = MorphImages(images, (unsigned long)number_images, &exception);
561
+ new_images = MorphImages(images, (unsigned long)number_images, exception);
550
562
  rm_split(images);
551
- rm_check_exception(&exception, new_images, DestroyOnError);
552
- (void) DestroyExceptionInfo(&exception);
563
+ rm_check_exception(exception, new_images, DestroyOnError);
564
+ (void) DestroyExceptionInfo(exception);
553
565
 
554
566
  rm_ensure_result(new_images);
555
567
 
@@ -570,20 +582,20 @@ VALUE
570
582
  ImageList_mosaic(VALUE self)
571
583
  {
572
584
  Image *images, *new_image;
573
- ExceptionInfo exception;
585
+ ExceptionInfo *exception;
574
586
 
575
- GetExceptionInfo(&exception);
587
+ exception = AcquireExceptionInfo();
576
588
  images = images_from_imagelist(self);
577
589
 
578
590
  #if defined(HAVE_ENUM_MOSAICLAYER)
579
- new_image = MergeImageLayers(images, MosaicLayer, &exception);
591
+ new_image = MergeImageLayers(images, MosaicLayer, exception);
580
592
  #else
581
- new_image = MosaicImages(images, &exception);
593
+ new_image = MosaicImages(images, exception);
582
594
  #endif
583
595
 
584
596
  rm_split(images);
585
- rm_check_exception(&exception, new_image, DestroyOnError);
586
- (void) DestroyExceptionInfo(&exception);
597
+ rm_check_exception(exception, new_image, DestroyOnError);
598
+ (void) DestroyExceptionInfo(exception);
587
599
 
588
600
  rm_ensure_result(new_image);
589
601
 
@@ -606,12 +618,12 @@ ImageList_optimize_layers(VALUE self, VALUE method)
606
618
  {
607
619
  Image *images, *new_images, *new_images2;
608
620
  LAYERMETHODTYPE mthd;
609
- ExceptionInfo exception;
621
+ ExceptionInfo *exception;
610
622
  QuantizeInfo quantize_info;
611
623
 
612
624
  new_images2 = NULL; // defeat "unused variable" message
613
625
 
614
- GetExceptionInfo(&exception);
626
+ exception = AcquireExceptionInfo();
615
627
  #if defined(HAVE_TYPE_IMAGELAYERMETHOD)
616
628
  VALUE_TO_ENUM(method, mthd, ImageLayerMethod);
617
629
  #else
@@ -622,22 +634,22 @@ ImageList_optimize_layers(VALUE self, VALUE method)
622
634
  switch (mthd)
623
635
  {
624
636
  case CoalesceLayer:
625
- new_images = CoalesceImages(images, &exception);
637
+ new_images = CoalesceImages(images, exception);
626
638
  break;
627
639
  case DisposeLayer:
628
- new_images = DisposeImages(images, &exception);
640
+ new_images = DisposeImages(images, exception);
629
641
  break;
630
642
  case OptimizeTransLayer:
631
643
  new_images = clone_imagelist(images);
632
- OptimizeImageTransparency(new_images, &exception);
644
+ OptimizeImageTransparency(new_images, exception);
633
645
  break;
634
646
  case RemoveDupsLayer:
635
647
  new_images = clone_imagelist(images);
636
- RemoveDuplicateLayers(&new_images, &exception);
648
+ RemoveDuplicateLayers(&new_images, exception);
637
649
  break;
638
650
  case RemoveZeroLayer:
639
651
  new_images = clone_imagelist(images);
640
- RemoveZeroDelayLayers(&new_images, &exception);
652
+ RemoveZeroDelayLayers(&new_images, exception);
641
653
  break;
642
654
  case CompositeLayer:
643
655
  rm_split(images);
@@ -645,19 +657,19 @@ ImageList_optimize_layers(VALUE self, VALUE method)
645
657
  break;
646
658
  // In 6.3.4-ish, OptimizeImageLayer replaced OptimizeLayer
647
659
  case OptimizeImageLayer:
648
- new_images = OptimizeImageLayers(images, &exception);
660
+ new_images = OptimizeImageLayers(images, exception);
649
661
  break;
650
662
  // and OptimizeLayer became a "General Purpose, GIF Animation Optimizer" (ref. mogrify.c)
651
663
  case OptimizeLayer:
652
- new_images = CoalesceImages(images, &exception);
664
+ new_images = CoalesceImages(images, exception);
653
665
  rm_split(images);
654
- rm_check_exception(&exception, new_images, DestroyOnError);
655
- new_images2 = OptimizeImageLayers(new_images, &exception);
666
+ rm_check_exception(exception, new_images, DestroyOnError);
667
+ new_images2 = OptimizeImageLayers(new_images, exception);
656
668
  DestroyImageList(new_images);
657
- rm_check_exception(&exception, new_images2, DestroyOnError);
669
+ rm_check_exception(exception, new_images2, DestroyOnError);
658
670
  new_images = new_images2;
659
- OptimizeImageTransparency(new_images, &exception);
660
- rm_check_exception(&exception, new_images, DestroyOnError);
671
+ OptimizeImageTransparency(new_images, exception);
672
+ rm_check_exception(exception, new_images, DestroyOnError);
661
673
  // mogrify supports -dither here. We don't.
662
674
  #if defined(HAVE_REMAPIMAGE)
663
675
  GetQuantizeInfo(&quantize_info);
@@ -667,31 +679,31 @@ ImageList_optimize_layers(VALUE self, VALUE method)
667
679
  #endif
668
680
  break;
669
681
  case OptimizePlusLayer:
670
- new_images = OptimizePlusImageLayers(images, &exception);
682
+ new_images = OptimizePlusImageLayers(images, exception);
671
683
  break;
672
684
  case CompareAnyLayer:
673
685
  case CompareClearLayer:
674
686
  case CompareOverlayLayer:
675
- new_images = CompareImageLayers(images, mthd, &exception);
687
+ new_images = CompareImageLayers(images, mthd, exception);
676
688
  break;
677
689
  #if defined(HAVE_ENUM_MOSAICLAYER)
678
690
  case MosaicLayer:
679
- new_images = MergeImageLayers(images, mthd, &exception);
691
+ new_images = MergeImageLayers(images, mthd, exception);
680
692
  break;
681
693
  #endif
682
694
  #if defined(HAVE_ENUM_FLATTENLAYER)
683
695
  case FlattenLayer:
684
- new_images = MergeImageLayers(images, mthd, &exception);
696
+ new_images = MergeImageLayers(images, mthd, exception);
685
697
  break;
686
698
  #endif
687
699
  #if defined(HAVE_ENUM_MERGELAYER)
688
700
  case MergeLayer:
689
- new_images = MergeImageLayers(images, mthd, &exception);
701
+ new_images = MergeImageLayers(images, mthd, exception);
690
702
  break;
691
703
  #endif
692
704
  #if defined(HAVE_ENUM_TRIMBOUNDSLAYER)
693
705
  case TrimBoundsLayer:
694
- new_images = MergeImageLayers(images, mthd, &exception);
706
+ new_images = MergeImageLayers(images, mthd, exception);
695
707
  break;
696
708
  #endif
697
709
  default:
@@ -701,8 +713,8 @@ ImageList_optimize_layers(VALUE self, VALUE method)
701
713
  }
702
714
 
703
715
  rm_split(images);
704
- rm_check_exception(&exception, new_images, DestroyOnError);
705
- (void) DestroyExceptionInfo(&exception);
716
+ rm_check_exception(exception, new_images, DestroyOnError);
717
+ (void) DestroyExceptionInfo(exception);
706
718
 
707
719
  rm_ensure_result(new_images);
708
720
 
@@ -881,20 +893,20 @@ static Image *
881
893
  clone_imagelist(Image *images)
882
894
  {
883
895
  Image *new_imagelist = NULL, *image, *clone;
884
- ExceptionInfo exception;
896
+ ExceptionInfo *exception;
885
897
 
886
- GetExceptionInfo(&exception);
898
+ exception = AcquireExceptionInfo();
887
899
 
888
900
  image = GetFirstImageInList(images);
889
901
  while (image)
890
902
  {
891
- clone = CloneImage(image, 0, 0, MagickTrue, &exception);
892
- rm_check_exception(&exception, new_imagelist, DestroyOnError);
903
+ clone = CloneImage(image, 0, 0, MagickTrue, exception);
904
+ rm_check_exception(exception, new_imagelist, DestroyOnError);
893
905
  AppendImageToList(&new_imagelist, clone);
894
906
  image = GetNextImageInList(image);
895
907
  }
896
908
 
897
- (void) DestroyExceptionInfo(&exception);
909
+ (void) DestroyExceptionInfo(exception);
898
910
  return new_imagelist;
899
911
  }
900
912
 
@@ -929,7 +941,7 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
929
941
  Image *images, *new_images;
930
942
  Image *new_image;
931
943
  QuantizeInfo quantize_info;
932
- ExceptionInfo exception;
944
+ ExceptionInfo *exception;
933
945
  volatile VALUE new_imagelist, scene;
934
946
 
935
947
  GetQuantizeInfo(&quantize_info);
@@ -963,18 +975,18 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
963
975
 
964
976
 
965
977
  // Convert image array to image sequence, clone image sequence.
966
- GetExceptionInfo(&exception);
978
+ exception = AcquireExceptionInfo();
967
979
  images = images_from_imagelist(self);
968
- new_images = CloneImageList(images, &exception);
980
+ new_images = CloneImageList(images, exception);
969
981
  rm_split(images);
970
- rm_check_exception(&exception, new_images, DestroyOnError);
971
- (void) DestroyExceptionInfo(&exception);
982
+ rm_check_exception(exception, new_images, DestroyOnError);
972
983
 
973
984
  rm_ensure_result(new_images);
974
985
 
975
986
 
976
987
  (void) QuantizeImages(&quantize_info, new_images);
977
- rm_check_exception(&exception, new_images, DestroyOnError);
988
+ rm_check_exception(exception, new_images, DestroyOnError);
989
+ (void) DestroyExceptionInfo(exception);
978
990
 
979
991
  // Create new ImageList object, convert mapped image sequence to images,
980
992
  // append to images array.
@@ -1079,7 +1091,7 @@ ImageList_to_blob(VALUE self)
1079
1091
  volatile VALUE blob_str;
1080
1092
  void *blob = NULL;
1081
1093
  size_t length = 0;
1082
- ExceptionInfo exception;
1094
+ ExceptionInfo *exception;
1083
1095
 
1084
1096
  info_obj = rm_info_new();
1085
1097
  Data_Get_Struct(info_obj, Info, info);
@@ -1087,9 +1099,9 @@ ImageList_to_blob(VALUE self)
1087
1099
  // Convert the images array to an images sequence.
1088
1100
  images = images_from_imagelist(self);
1089
1101
 
1090
- GetExceptionInfo(&exception);
1091
- (void) SetImageInfo(info, MagickTrue, &exception);
1092
- rm_check_exception(&exception, images, RetainOnError);
1102
+ exception = AcquireExceptionInfo();
1103
+ (void) SetImageInfo(info, MagickTrue, exception);
1104
+ rm_check_exception(exception, images, RetainOnError);
1093
1105
 
1094
1106
  if (*info->magick != '\0')
1095
1107
  {
@@ -1109,8 +1121,8 @@ ImageList_to_blob(VALUE self)
1109
1121
  // can happen is that there's only one image or the format
1110
1122
  // doesn't support multi-image files.
1111
1123
  info->adjoin = MagickTrue;
1112
- blob = ImagesToBlob(info, images, &length, &exception);
1113
- if (blob && exception.severity >= ErrorException)
1124
+ blob = ImagesToBlob(info, images, &length, exception);
1125
+ if (blob && exception->severity >= ErrorException)
1114
1126
  {
1115
1127
  magick_free((void*)blob);
1116
1128
  blob = NULL;
@@ -1118,7 +1130,7 @@ ImageList_to_blob(VALUE self)
1118
1130
  }
1119
1131
  rm_split(images);
1120
1132
  CHECK_EXCEPTION()
1121
- (void) DestroyExceptionInfo(&exception);
1133
+ (void) DestroyExceptionInfo(exception);
1122
1134
 
1123
1135
 
1124
1136
  if (length == 0 || !blob)
@@ -1154,7 +1166,7 @@ ImageList_write(VALUE self, VALUE file)
1154
1166
  const MagickInfo *m;
1155
1167
  volatile VALUE info_obj;
1156
1168
  unsigned long scene;
1157
- ExceptionInfo exception;
1169
+ ExceptionInfo *exception;
1158
1170
 
1159
1171
  info_obj = rm_info_new();
1160
1172
  Data_Get_Struct(info_obj, Info, info);
@@ -1166,7 +1178,12 @@ ImageList_write(VALUE self, VALUE file)
1166
1178
 
1167
1179
  // Ensure file is open - raise error if not
1168
1180
  GetOpenFile(file, fptr);
1181
+ #if defined(_WIN32)
1182
+ add_format_prefix(info, fptr->pathv);
1183
+ SetImageInfoFile(info, NULL);
1184
+ #else
1169
1185
  SetImageInfoFile(info, GetReadFile(fptr));
1186
+ #endif
1170
1187
  }
1171
1188
  else
1172
1189
  {
@@ -1186,13 +1203,13 @@ ImageList_write(VALUE self, VALUE file)
1186
1203
  }
1187
1204
 
1188
1205
  // Find out if the format supports multi-images files.
1189
- GetExceptionInfo(&exception);
1190
- (void) SetImageInfo(info, MagickTrue, &exception);
1191
- rm_check_exception(&exception, images, RetainOnError);
1206
+ exception = AcquireExceptionInfo();
1207
+ (void) SetImageInfo(info, MagickTrue, exception);
1208
+ rm_check_exception(exception, images, RetainOnError);
1192
1209
 
1193
- m = GetMagickInfo(info->magick, &exception);
1194
- rm_check_exception(&exception, images, RetainOnError);
1195
- (void) DestroyExceptionInfo(&exception);
1210
+ m = GetMagickInfo(info->magick, exception);
1211
+ rm_check_exception(exception, images, RetainOnError);
1212
+ (void) DestroyExceptionInfo(exception);
1196
1213
 
1197
1214
  // Tell WriteImage if we want a multi-images file.
1198
1215
  if (imagelist_length(self) > 1L && m->adjoin)