rmagick 2.7.2 → 2.8.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.

data/ext/RMagick/rminfo.c CHANGED
@@ -1,4 +1,4 @@
1
- /* $Id: rminfo.c,v 1.73 2008/11/13 00:06:57 rmagick Exp $ */
1
+ /* $Id: rminfo.c,v 1.74 2008/11/15 21:30:50 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2008 by Timothy P. Hunter
4
4
  | Name: rminfo.c
@@ -844,6 +844,38 @@ Info_dispose_eq(VALUE self, VALUE disp)
844
844
  DEF_ATTR_ACCESSOR(Info, dither, bool)
845
845
 
846
846
 
847
+ /*
848
+ Method: Info#endian
849
+ Info#endian = Maigck::MSBEndian or LSBEndian
850
+ Purpose: Set the Image::Info#endian attribute for reading
851
+ */
852
+ VALUE
853
+ Info_endian(VALUE self)
854
+ {
855
+ Info *info;
856
+
857
+ Data_Get_Struct(self, Info, info);
858
+ return EndianType_new(info->endian);
859
+ }
860
+
861
+
862
+ VALUE
863
+ Info_endian_eq(VALUE self, VALUE endian)
864
+ {
865
+ Info *info;
866
+ EndianType type = UndefinedEndian;
867
+
868
+ if (endian != Qnil)
869
+ {
870
+ VALUE_TO_ENUM(endian, type, EndianType);
871
+ }
872
+
873
+ Data_Get_Struct(self, Info, info);
874
+ info->endian = type;
875
+ return self;
876
+ }
877
+
878
+
847
879
  /*
848
880
  Method: aString=Info#extract
849
881
  Info#extract=aString
@@ -1451,9 +1483,45 @@ Info_sampling_factor_eq(VALUE self, VALUE sampling_factor)
1451
1483
  return self;
1452
1484
  }
1453
1485
 
1454
- DEF_ATTR_ACCESSOR(Info, scene, ulong)
1486
+
1487
+ /*
1488
+ Method: Info#scene
1489
+ Info#scene=
1490
+ Purpose: Get/Set the scene number
1491
+ */
1492
+ VALUE
1493
+ Info_scene(VALUE self)
1494
+ {
1495
+ Info *info;
1496
+
1497
+ Data_Get_Struct(self, Info, info);
1498
+ return ULONG2NUM(info->scene);
1499
+ }
1500
+
1501
+
1502
+ VALUE
1503
+ Info_scene_eq(VALUE self, VALUE scene)
1504
+ {
1505
+ Info *info;
1506
+ char buf[25];
1507
+
1508
+ Data_Get_Struct(self, Info, info);
1509
+ info->scene = NUM2ULONG(scene);
1510
+
1511
+ #if defined(HAVE_SNPRINTF)
1512
+ (void) snprintf(buf, sizeof(buf), "%-ld", info->scene);
1513
+ #else
1514
+ (void) sprintf(buf, "%-l", info->scene);
1515
+ #endif
1516
+ (void) SetImageOption(info, "scene", buf);
1517
+
1518
+ return self;
1519
+ }
1520
+
1521
+
1455
1522
  DEF_ATTR_READER(Info, server_name, str)
1456
1523
 
1524
+
1457
1525
  /*
1458
1526
  Method: Info#server_name=<aString>
1459
1527
  Purpose: Set the server name
@@ -1624,6 +1692,39 @@ Info_tile_offset_eq(VALUE self, VALUE offset)
1624
1692
  }
1625
1693
 
1626
1694
 
1695
+ /*
1696
+ Method: Info#transparent_color
1697
+ Purpose: return the name of the transparent color as a String
1698
+ Note: Compare with Image#transparent_color!
1699
+ */
1700
+ VALUE
1701
+ Info_transparent_color(VALUE self)
1702
+ {
1703
+ Info *info;
1704
+
1705
+ Data_Get_Struct(self, Info, info);
1706
+ return PixelPacket_to_Color_Name_Info(info, &info->transparent_color);
1707
+ }
1708
+
1709
+
1710
+ /*
1711
+ Method: Info#transparent_color=<aString>
1712
+ Purpose: set the transparent color
1713
+ Raises: ArgumentError
1714
+ */
1715
+ VALUE
1716
+ Info_transparent_color_eq(VALUE self, VALUE tc_arg)
1717
+ {
1718
+ Info *info;
1719
+ char colorname[MaxTextExtent];
1720
+
1721
+ Data_Get_Struct(self, Info, info);
1722
+ Color_to_PixelPacket(&info->transparent_color, tc_arg);
1723
+ SetImageOption(info, "transparent", pixel_packet_to_hexname(&info->transparent_color, colorname));
1724
+ return self;
1725
+ }
1726
+
1727
+
1627
1728
  /*
1628
1729
  Method: Image::Info#tile_offset
1629
1730
  Purpose: returns tile_offset attribute values
data/ext/RMagick/rmmain.c CHANGED
@@ -1,4 +1,4 @@
1
- /* $Id: rmmain.c,v 1.275 2008/10/30 23:22:46 rmagick Exp $ */
1
+ /* $Id: rmmain.c,v 1.280 2008/12/02 22:57:42 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2008 by Timothy P. Hunter
4
4
  | Name: rmmain.c
@@ -169,7 +169,7 @@ Magick_init_formats(VALUE class)
169
169
  /*
170
170
  Method: Magick.limit_resource(resource[, limit])
171
171
  Purpose: Get/set resource limits. If a limit is specified the old limit
172
- is set to the new value. Either way the current/new limit is returned.
172
+ is set to the new value. Either way the current/old limit is returned.
173
173
  */
174
174
  static VALUE
175
175
  Magick_limit_resource(int argc, VALUE *argv, VALUE class)
@@ -664,6 +664,7 @@ Init_RMagick2(void)
664
664
  rb_define_method(Class_Image, "to_color", Image_to_color, 1);
665
665
  rb_define_method(Class_Image, "to_blob", Image_to_blob, 0);
666
666
  rb_define_method(Class_Image, "transparent", Image_transparent, -1);
667
+ rb_define_method(Class_Image, "transparent_chroma", Image_transparent_chroma, -1);
667
668
  rb_define_method(Class_Image, "transpose", Image_transpose, 0);
668
669
  rb_define_method(Class_Image, "transpose!", Image_transpose_bang, 0);
669
670
  rb_define_method(Class_Image, "transverse", Image_transverse, 0);
@@ -893,6 +894,7 @@ Init_RMagick2(void)
893
894
  DCL_ATTR_ACCESSOR(Info, depth)
894
895
  DCL_ATTR_ACCESSOR(Info, dispose)
895
896
  DCL_ATTR_ACCESSOR(Info, dither)
897
+ DCL_ATTR_ACCESSOR(Info, endian)
896
898
  DCL_ATTR_ACCESSOR(Info, extract)
897
899
  DCL_ATTR_ACCESSOR(Info, filename)
898
900
  DCL_ATTR_ACCESSOR(Info, fill)
@@ -921,6 +923,7 @@ Init_RMagick2(void)
921
923
  DCL_ATTR_ACCESSOR(Info, stroke_width)
922
924
  DCL_ATTR_WRITER(Info, texture)
923
925
  DCL_ATTR_ACCESSOR(Info, tile_offset)
926
+ DCL_ATTR_ACCESSOR(Info, transparent_color)
924
927
  DCL_ATTR_ACCESSOR(Info, undercolor)
925
928
  DCL_ATTR_ACCESSOR(Info, units)
926
929
  DCL_ATTR_ACCESSOR(Info, view)
@@ -1571,12 +1574,12 @@ Init_RMagick2(void)
1571
1574
  ENUMERATOR(PixelsPerCentimeterResolution)
1572
1575
  END_ENUM
1573
1576
 
1574
- #if defined(HAVE_SPARSECOLORINTERPOLATE)
1575
- DEF_ENUM(SparseColorInterpolateMethod)
1577
+ #if defined(HAVE_SPARSECOLORIMAGE)
1578
+ DEF_ENUM(SparseColorMethod)
1576
1579
  ENUMERATOR(UndefinedColorInterpolate)
1577
1580
  ENUMERATOR(BarycentricColorInterpolate)
1578
1581
  ENUMERATOR(BilinearColorInterpolate)
1579
- ENUMERATOR(PolynomialColorInterpolate)
1582
+ //ENUMERATOR(PolynomialColorInterpolate)
1580
1583
  ENUMERATOR(ShepardsColorInterpolate)
1581
1584
  ENUMERATOR(VoronoiColorInterpolate)
1582
1585
  END_ENUM
@@ -1777,7 +1780,7 @@ test_Magick_version(void)
1777
1780
  }
1778
1781
 
1779
1782
  rb_raise(rb_eRuntimeError,
1780
- "This version of RMagick was created to run with %s %s but %.*s is in use.\n" ,
1783
+ "This version of RMagick was configured with %s %s but %.*s is in use.\n" ,
1781
1784
  MagickPackageName, MagickLibVersionText, x, version_str);
1782
1785
  }
1783
1786
 
@@ -1809,7 +1812,7 @@ version_constants(void)
1809
1812
  rb_define_const(Module_Magick, "Version", str);
1810
1813
 
1811
1814
  sprintf(long_version,
1812
- "This is %s ($Date: 2008/10/30 23:22:46 $) Copyright (C) 2008 by Timothy P. Hunter\n"
1815
+ "This is %s ($Date: 2008/12/02 22:57:42 $) Copyright (C) 2008 by Timothy P. Hunter\n"
1813
1816
  "Built with %s\n"
1814
1817
  "Built for %s\n"
1815
1818
  "Web page: http://rmagick.rubyforge.org\n"
data/ext/RMagick/rmutil.c CHANGED
@@ -1,4 +1,4 @@
1
- /* $Id: rmutil.c,v 1.171 2008/11/13 00:02:22 rmagick Exp $ */
1
+ /* $Id: rmutil.c,v 1.172 2008/11/15 21:30:51 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2008 by Timothy P. Hunter
4
4
  | Name: rmutil.c
@@ -3477,11 +3477,6 @@ void rm_sync_image_options(Image *image, Info *info)
3477
3477
  image->border_color = info->border_color;
3478
3478
  }
3479
3479
 
3480
- if (info->colors != 0)
3481
- {
3482
- image->colors = info->colors;
3483
- }
3484
-
3485
3480
  if (info->colorspace != UndefinedColorspace)
3486
3481
  {
3487
3482
  image->colorspace = info->colorspace;
@@ -3562,6 +3557,12 @@ void rm_sync_image_options(Image *image, Info *info)
3562
3557
  image->quality = info->quality;
3563
3558
  }
3564
3559
 
3560
+ option = GetImageOption(info, "scene");
3561
+ if (option)
3562
+ {
3563
+ image->scene = info->scene;
3564
+ }
3565
+
3565
3566
  #if defined(HAVE_ST_TILE_OFFSET)
3566
3567
  option = GetImageOption(info, "tile-offset");
3567
3568
  if (option)
@@ -3570,7 +3571,7 @@ void rm_sync_image_options(Image *image, Info *info)
3570
3571
  }
3571
3572
  #endif
3572
3573
 
3573
- option = GetImageOption(info, "transparent-color");
3574
+ option = GetImageOption(info, "transparent");
3574
3575
  if (option)
3575
3576
  {
3576
3577
  image->transparent_color = info->transparent_color;
data/rmagick.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
  Gem::Specification.new do |s|
3
3
  s.name = %q{rmagick}
4
- s.version = "2.7.2"
4
+ s.version = "2.8.0"
5
5
  s.date = Date.today.to_s
6
6
  s.summary = %q{Ruby binding to ImageMagick}
7
7
  s.description = %q{RMagick is an interface between Ruby and ImageMagick.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmagick
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.2
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Hunter
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-13 00:00:00 -05:00
12
+ date: 2008-12-04 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -119,6 +119,7 @@ files:
119
119
  - doc/ex/stegano.rb
120
120
  - doc/ex/roundrect.rb
121
121
  - doc/ex/wet_floor.rb
122
+ - doc/ex/sparse_color.rb
122
123
  - doc/ex/Use02.rb
123
124
  - doc/ex/nonzero.rb
124
125
  - doc/ex/watermark.rb