rmagick 4.2.2 → 4.2.3
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/.github/workflows/ci.yml +4 -35
- data/CHANGELOG.md +11 -0
- data/ext/RMagick/extconf.rb +1 -1
- data/ext/RMagick/rmagick.h +3 -0
- data/ext/RMagick/rmdraw.c +3 -0
- data/ext/RMagick/rmilist.c +4 -3
- data/ext/RMagick/rmimage.c +37 -28
- data/ext/RMagick/rminfo.c +2 -1
- data/ext/RMagick/rmmontage.c +4 -4
- data/ext/RMagick/rmpixel.c +2 -2
- data/ext/RMagick/rmstruct.c +2 -2
- data/ext/RMagick/rmutil.c +20 -0
- data/lib/rmagick/version.rb +1 -1
- data/lib/rvg/rvg.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f03e7c8f9a11d13e6d238c0f9af950c6024f42318c7f877fdedf8754d08afa9
|
4
|
+
data.tar.gz: 8c37ca64ae0b07f2dbf05b8e1bbe670510ca702434a214bee4346d4e89ea86ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64f6253d514ccc95f5dc1d2adcecdee8ccac2590eb113cf1f669b0381656ab3d021f358e394c7477635f2a92a44280ea67fb9c696d6542c6c64329341ba1f746
|
7
|
+
data.tar.gz: 5218852ac35cf26aecb5d8507921da099fb89c642bdf8d3663f2c7022171a9d36a1a96d2b193d688a3be8aa8c6543999e8ea84d1d0f992dbb97ef64cc7d7fe73
|
data/.github/workflows/ci.yml
CHANGED
@@ -31,8 +31,8 @@ jobs:
|
|
31
31
|
imagemagick-version:
|
32
32
|
- { full: 6.7.7-10, major-minor: '6.7' }
|
33
33
|
- { full: 6.8.9-10, major-minor: '6.8' }
|
34
|
-
- { full: 6.9.
|
35
|
-
- { full: 7.0
|
34
|
+
- { full: 6.9.12-15, major-minor: '6.9' }
|
35
|
+
- { full: 7.1.0-0, major-minor: '7.0' }
|
36
36
|
|
37
37
|
name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
38
38
|
steps:
|
@@ -57,8 +57,8 @@ jobs:
|
|
57
57
|
matrix:
|
58
58
|
ruby-version: ['2.6', '2.7', '3.0']
|
59
59
|
imagemagick-version:
|
60
|
-
- { full: 6.9.
|
61
|
-
- { full: 7.0
|
60
|
+
- { full: 6.9.12-15, major-minor: '6.9' }
|
61
|
+
- { full: 7.1.0-0, major-minor: '7.0' }
|
62
62
|
|
63
63
|
name: macOS, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
64
64
|
steps:
|
@@ -74,34 +74,3 @@ jobs:
|
|
74
74
|
run: |
|
75
75
|
bundle install --path=vendor/bundle --jobs 4 --retry 3
|
76
76
|
bundle exec rake
|
77
|
-
|
78
|
-
test-windows:
|
79
|
-
runs-on: windows-latest
|
80
|
-
timeout-minutes: 10
|
81
|
-
strategy:
|
82
|
-
matrix:
|
83
|
-
ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0']
|
84
|
-
imagemagick-version:
|
85
|
-
- { full: 6.8.9-10, major-minor: '6.8' }
|
86
|
-
- { full: 6.9.11-29, major-minor: '6.9' } # seems that binary file mirroring have stopped.
|
87
|
-
- { full: 7.0.10-29, major-minor: '7.0' } # seems that binary file mirroring have stopped.
|
88
|
-
name: MSWin, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
89
|
-
steps:
|
90
|
-
- uses: actions/checkout@v2
|
91
|
-
- name: Set up Ruby ${{ matrix.ruby-version }}
|
92
|
-
uses: ruby/setup-ruby@master
|
93
|
-
with:
|
94
|
-
ruby-version: ${{ matrix.ruby-version }}
|
95
|
-
- name: Install ImageMagick
|
96
|
-
run: |
|
97
|
-
$imagemagick_version = "${{ matrix.imagemagick-version.full }}"
|
98
|
-
$imagemagick_version_without_patch = $imagemagick_version.split("-")[0]
|
99
|
-
$installer_name = "ImageMagick-$($imagemagick_version)-Q16-x64-dll.exe"
|
100
|
-
$url = "https://ftp.icm.edu.pl/pub/graphics/ImageMagick/binaries/$($installer_name)"
|
101
|
-
choco install wget
|
102
|
-
choco install ghostscript -Version 9.50
|
103
|
-
wget $url --progress=dot
|
104
|
-
cmd.exe /D /S /C "$($installer_name) /DIR=D:\ImageMagick /VERYSILENT /TASKS=install_Devel"
|
105
|
-
- name: Build and test with Rake
|
106
|
-
run: |
|
107
|
-
cmd.exe /D /S /C "SET MAKE=make & SET PATH=D:\ImageMagick;%PATH% & bundle install --path=vendor/bundle --retry 3 & bundle exec rake"
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,17 @@
|
|
3
3
|
All notable changes to this project are documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## RMagick 4.2.3
|
7
|
+
|
8
|
+
Bug Fixes
|
9
|
+
|
10
|
+
- Re-add block syntax deprecation warning and fix in RMagick source (#1279) (#1280)
|
11
|
+
- Doc: Replace Magick::Montage with Magick::ImageList::Montage (#1281)
|
12
|
+
- Update shadow example (#1297)
|
13
|
+
- Escape the backslashes in windows error message (#1298)
|
14
|
+
- Also set the alpha value of the target pixel (#1299)
|
15
|
+
- Set alpha_trait to BlendPixelTrait when the alpha value of the pixel is not opaque. (#1300)
|
16
|
+
|
6
17
|
## RMagick 4.2.2
|
7
18
|
|
8
19
|
Bug Fixes:
|
data/ext/RMagick/extconf.rb
CHANGED
@@ -258,7 +258,7 @@ module RMagick
|
|
258
258
|
Retry with '--with-opt-dir' option.
|
259
259
|
Usage: gem install rmagick -- '--with-opt-dir=\"[path to ImageMagick]\"'
|
260
260
|
e.g.
|
261
|
-
gem install rmagick -- '--with-opt-dir=\"C
|
261
|
+
gem install rmagick -- '--with-opt-dir=\"C:\\Program Files\\ImageMagick-6.9.1-Q16\"'
|
262
262
|
END_MINGW
|
263
263
|
end
|
264
264
|
|
data/ext/RMagick/rmagick.h
CHANGED
@@ -1173,6 +1173,9 @@ extern void rm_set_user_artifact(Image *, Info *);
|
|
1173
1173
|
extern void rm_sync_image_options(Image *, Info *);
|
1174
1174
|
extern void rm_split(Image *);
|
1175
1175
|
extern void rm_magick_error(const char *);
|
1176
|
+
#if defined(IMAGEMAGICK_7)
|
1177
|
+
extern void rm_set_pixelinfo_alpha(PixelInfo *, const MagickRealType);
|
1178
|
+
#endif
|
1176
1179
|
|
1177
1180
|
//! whether to retain on errors
|
1178
1181
|
typedef enum
|
data/ext/RMagick/rmdraw.c
CHANGED
@@ -856,6 +856,7 @@ VALUE Draw_annotate(
|
|
856
856
|
if (rb_proc_arity(rb_block_proc()) == 0)
|
857
857
|
{
|
858
858
|
// Run the block in self's context
|
859
|
+
rb_warn("passing a block without an image argument is deprecated");
|
859
860
|
rb_obj_instance_eval(0, NULL, self);
|
860
861
|
}
|
861
862
|
else
|
@@ -1396,6 +1397,7 @@ DrawOptions_initialize(VALUE self)
|
|
1396
1397
|
if (rb_proc_arity(rb_block_proc()) == 0)
|
1397
1398
|
{
|
1398
1399
|
// Run the block in self's context
|
1400
|
+
rb_warn("passing a block without an image argument is deprecated");
|
1399
1401
|
rb_obj_instance_eval(0, NULL, self);
|
1400
1402
|
}
|
1401
1403
|
else
|
@@ -1467,6 +1469,7 @@ PolaroidOptions_initialize(VALUE self)
|
|
1467
1469
|
if (rb_proc_arity(rb_block_proc()) == 0)
|
1468
1470
|
{
|
1469
1471
|
// Run the block in self's context
|
1472
|
+
rb_warn("passing a block without an image argument is deprecated");
|
1470
1473
|
rb_obj_instance_eval(0, NULL, self);
|
1471
1474
|
}
|
1472
1475
|
else
|
data/ext/RMagick/rmilist.c
CHANGED
@@ -428,7 +428,7 @@ ImageList_flatten_images(VALUE self)
|
|
428
428
|
* @overload montage
|
429
429
|
* Creates {Magick::ImageList::Montage} object, yields to block
|
430
430
|
* if present in {Magick::ImageList::Montage} object's scope.
|
431
|
-
* @yield []
|
431
|
+
* @yield [Magick::ImageList::Montage]
|
432
432
|
*
|
433
433
|
* @return [Magick::ImageList] a new image list
|
434
434
|
*/
|
@@ -440,7 +440,7 @@ ImageList_montage(VALUE self)
|
|
440
440
|
Image *new_images, *images;
|
441
441
|
ExceptionInfo *exception;
|
442
442
|
|
443
|
-
// Create a new instance of the Magick::Montage class
|
443
|
+
// Create a new instance of the Magick::ImageList::Montage class
|
444
444
|
montage_obj = rm_montage_new();
|
445
445
|
if (rb_block_given_p())
|
446
446
|
{
|
@@ -448,6 +448,7 @@ ImageList_montage(VALUE self)
|
|
448
448
|
// object's attributes.
|
449
449
|
if (rb_proc_arity(rb_block_proc()) == 0)
|
450
450
|
{
|
451
|
+
rb_warn("passing a block without an image argument is deprecated");
|
451
452
|
rb_obj_instance_eval(0, NULL, montage_obj);
|
452
453
|
}
|
453
454
|
else
|
@@ -1008,7 +1009,7 @@ ImageList_remap(int argc, VALUE *argv, VALUE self)
|
|
1008
1009
|
*
|
1009
1010
|
* @overload to_blob
|
1010
1011
|
* Runs an info parm block if present - the user can specify the image format and depth
|
1011
|
-
* @yield []
|
1012
|
+
* @yield [Magick::Image::Info]
|
1012
1013
|
*
|
1013
1014
|
* @return [String] the blob
|
1014
1015
|
*/
|
data/ext/RMagick/rmimage.c
CHANGED
@@ -1990,12 +1990,12 @@ Image_bounding_box(VALUE self)
|
|
1990
1990
|
* importantly, you can capture menus or other popups that are independent windows but appear
|
1991
1991
|
* over the specified window.
|
1992
1992
|
* @param borders [Boolean] If true, include the border in the image.
|
1993
|
-
* @yield []
|
1993
|
+
* @yield [Magick::Image::Info]
|
1994
1994
|
*
|
1995
1995
|
* @return [Magick::Image] a new image
|
1996
1996
|
* @example
|
1997
|
-
* img = Image.capture {
|
1998
|
-
*
|
1997
|
+
* img = Image.capture { |options|
|
1998
|
+
* options.filename = "root"
|
1999
1999
|
* }
|
2000
2000
|
*/
|
2001
2001
|
VALUE
|
@@ -3104,17 +3104,17 @@ Image_columns(VALUE self)
|
|
3104
3104
|
* @param channel [Magick::ChannelType] a ChannelType arguments.
|
3105
3105
|
*
|
3106
3106
|
* @overload compare_channel(image, metric, channel = Magick::AllChannels)
|
3107
|
-
*
|
3108
|
-
*
|
3109
|
-
* -
|
3107
|
+
* When a block is given, compare_channel yields with a block argument you can optionally use to
|
3108
|
+
* set attributes.
|
3109
|
+
* - options.highlight_color = color
|
3110
3110
|
* - Emphasize pixel differences with this color. The default is partially transparent red.
|
3111
|
-
* -
|
3111
|
+
* - options.lowlight_color = color
|
3112
3112
|
* - Demphasize pixel differences with this color. The default is partially transparent white.
|
3113
3113
|
* @param image [Magick::Image, Magick::ImageList] Either an imagelist or an image. If an
|
3114
3114
|
* imagelist, uses the current image.
|
3115
3115
|
* @param metric [Magick::MetricType] The desired distortion metric.
|
3116
3116
|
* @param channel [Magick::ChannelType] a ChannelType arguments.
|
3117
|
-
* @yield []
|
3117
|
+
* @yield [Magick::OptionalMethodArguments]
|
3118
3118
|
*
|
3119
3119
|
* @overload compare_channel(image, metric, *channels)
|
3120
3120
|
* @param image [Magick::Image, Magick::ImageList] Either an imagelist or an image. If an
|
@@ -3124,18 +3124,18 @@ Image_columns(VALUE self)
|
|
3124
3124
|
* @param *channels [Magick::ChannelType] one or more ChannelType arguments.
|
3125
3125
|
*
|
3126
3126
|
* @overload compare_channel(image, metric, *channels)
|
3127
|
-
*
|
3128
|
-
*
|
3129
|
-
* -
|
3127
|
+
* When a block is given, compare_channel yields with a block argument you can optionally use to
|
3128
|
+
* set attributes.
|
3129
|
+
* - options.highlight_color = color
|
3130
3130
|
* - Emphasize pixel differences with this color. The default is partially transparent red.
|
3131
|
-
* -
|
3131
|
+
* - options.lowlight_color = color
|
3132
3132
|
* - Demphasize pixel differences with this color. The default is partially transparent white.
|
3133
3133
|
* @param image [Magick::Image, Magick::ImageList] Either an imagelist or an image. If an
|
3134
3134
|
* imagelist, uses the current image.
|
3135
3135
|
* @param metric [Magick::MetricType] The desired distortion metric.
|
3136
3136
|
* @param channel [Magick::ChannelType] a ChannelType arguments.
|
3137
3137
|
* @param *channels [Magick::ChannelType] one or more ChannelType arguments.
|
3138
|
-
* @yield []
|
3138
|
+
* @yield [Magick::OptionalMethodArguments]
|
3139
3139
|
*
|
3140
3140
|
* @return [Array] The first element is a difference image, the second is a the value of the
|
3141
3141
|
* computed distortion represented as a Float.
|
@@ -5551,17 +5551,16 @@ Image_dissolve(int argc, VALUE *argv, VALUE self)
|
|
5551
5551
|
* the source image will be taken into account in the mapping.
|
5552
5552
|
*
|
5553
5553
|
* @overload distort(type, points, bestfit = false)
|
5554
|
-
*
|
5555
|
-
*
|
5556
|
-
* - self.define("distort:viewport", "WxH+X+Y")
|
5554
|
+
* When a block is given, distort yields with a block argument you can optionally use to set attributes.
|
5555
|
+
* - options.define("distort:viewport", "WxH+X+Y")
|
5557
5556
|
* - Specify the size and offset of the generated viewport image of the distorted image space. W and
|
5558
5557
|
* H are the width and height, and X and Y are the offset.
|
5559
|
-
* -
|
5558
|
+
* - options.define("distort:scale", N)
|
5560
5559
|
* - N is an integer factor. Scale the output image (viewport or otherwise) by that factor without
|
5561
5560
|
* changing the viewed contents of the distorted image. This can be used either for
|
5562
5561
|
* 'super-sampling' the image for a higher quality result, or for panning and zooming around
|
5563
5562
|
* the image (with appropriate viewport changes, or post-distort cropping and resizing).
|
5564
|
-
* -
|
5563
|
+
* - options.verbose(true)
|
5565
5564
|
* - Attempt to output the internal coefficients, and the -fx equivalent to the distortion, for
|
5566
5565
|
expert study, and debugging purposes. This many not be available for all distorts.
|
5567
5566
|
* @param type [Magick::DistortMethod] a DistortMethod value
|
@@ -5570,13 +5569,13 @@ Image_dissolve(int argc, VALUE *argv, VALUE self)
|
|
5570
5569
|
* image is adjusted to ensure the whole source image will just fit within the final destination
|
5571
5570
|
* image, which will be sized and offset accordingly. Also in many cases the virtual offset of
|
5572
5571
|
* the source image will be taken into account in the mapping.
|
5573
|
-
* @yield []
|
5572
|
+
* @yield [Magick::OptionalMethodArguments]
|
5574
5573
|
*
|
5575
5574
|
* @return [Magick::Image] a new image
|
5576
5575
|
* @example
|
5577
|
-
* img.distort(Magick::ScaleRotateTranslateDistortion, [0]) do
|
5578
|
-
*
|
5579
|
-
*
|
5576
|
+
* img.distort(Magick::ScaleRotateTranslateDistortion, [0]) do |options|
|
5577
|
+
* options.define "distort:viewport", "44x44+15+0"
|
5578
|
+
* options.define "distort:scale", 2
|
5580
5579
|
* end
|
5581
5580
|
*/
|
5582
5581
|
VALUE
|
@@ -6882,7 +6881,7 @@ Image_frame(int argc, VALUE *argv, VALUE self)
|
|
6882
6881
|
* @overload from_blob(blob)
|
6883
6882
|
* This yields {Magick::Image::Info} to block with its object's scope.
|
6884
6883
|
* @param blob [String] the blob data
|
6885
|
-
* @yield []
|
6884
|
+
* @yield [Magick::Image::Info]
|
6886
6885
|
*
|
6887
6886
|
* @return [Array<Magick::Image>] an array of new images
|
6888
6887
|
* @see Image#to_blob
|
@@ -8968,7 +8967,7 @@ Image_matte_flood_fill(int argc, VALUE *argv, VALUE self)
|
|
8968
8967
|
rb_raise(rb_eNoMemError, "not enough memory to continue");
|
8969
8968
|
}
|
8970
8969
|
#if defined(IMAGEMAGICK_7)
|
8971
|
-
draw_info->fill
|
8970
|
+
rm_set_pixelinfo_alpha(&draw_info->fill, alpha);
|
8972
8971
|
#else
|
8973
8972
|
draw_info->fill.opacity = QuantumRange - alpha;
|
8974
8973
|
#endif
|
@@ -8979,6 +8978,11 @@ Image_matte_flood_fill(int argc, VALUE *argv, VALUE self)
|
|
8979
8978
|
target_mpp.red = (MagickRealType) image->border_color.red;
|
8980
8979
|
target_mpp.green = (MagickRealType) image->border_color.green;
|
8981
8980
|
target_mpp.blue = (MagickRealType) image->border_color.blue;
|
8981
|
+
#if defined(IMAGEMAGICK_7)
|
8982
|
+
rm_set_pixelinfo_alpha(&target_mpp, (MagickRealType) image->border_color.alpha);
|
8983
|
+
#else
|
8984
|
+
target_mpp.opacity = (MagickRealType) image->border_color.opacity;
|
8985
|
+
#endif
|
8982
8986
|
}
|
8983
8987
|
else
|
8984
8988
|
{
|
@@ -8986,6 +8990,11 @@ Image_matte_flood_fill(int argc, VALUE *argv, VALUE self)
|
|
8986
8990
|
target_mpp.red = (MagickRealType) target.red;
|
8987
8991
|
target_mpp.green = (MagickRealType) target.green;
|
8988
8992
|
target_mpp.blue = (MagickRealType) target.blue;
|
8993
|
+
#if defined(IMAGEMAGICK_7)
|
8994
|
+
rm_set_pixelinfo_alpha(&target_mpp, (MagickRealType) target.alpha);
|
8995
|
+
#else
|
8996
|
+
target_mpp.opacity = (MagickRealType) target.opacity;
|
8997
|
+
#endif
|
8989
8998
|
}
|
8990
8999
|
|
8991
9000
|
#if defined(IMAGEMAGICK_7)
|
@@ -10349,11 +10358,11 @@ Image_pixel_interpolation_method_eq(VALUE self, VALUE method)
|
|
10349
10358
|
* If present a block, optional arguments may be specified in a block associated with the method.
|
10350
10359
|
* These arguments control the shadow color and how the label is rendered.
|
10351
10360
|
* By default the shadow color is gray75. To specify a different shadow color,
|
10352
|
-
* use
|
10353
|
-
* To specify a different border color (that is, the color of the image border) use
|
10361
|
+
* use options.shadow_color.
|
10362
|
+
* To specify a different border color (that is, the color of the image border) use options.border_color.
|
10354
10363
|
* Both of these methods accept either a color name or a Pixel argument.
|
10355
10364
|
* @param angle [Float] The resulting image is rotated by this amount, measured in degrees.
|
10356
|
-
* @yield []
|
10365
|
+
* @yield [Magick::Image::Info]
|
10357
10366
|
*
|
10358
10367
|
* @return [Magick::Image] a new image
|
10359
10368
|
*/
|
@@ -12325,7 +12334,7 @@ Image_segment(int argc, VALUE *argv, VALUE self)
|
|
12325
12334
|
* @return [Hash] the properties
|
12326
12335
|
*
|
12327
12336
|
* @overload properties
|
12328
|
-
* @yield []
|
12337
|
+
* @yield [Magick::Image::Info]
|
12329
12338
|
* @return [Magick::Image] self
|
12330
12339
|
*/
|
12331
12340
|
VALUE
|
data/ext/RMagick/rminfo.c
CHANGED
@@ -2405,7 +2405,7 @@ rm_info_new(void)
|
|
2405
2405
|
* @overload initialize
|
2406
2406
|
*
|
2407
2407
|
* @overload initialize
|
2408
|
-
* @yield []
|
2408
|
+
* @yield [Magick::Image::Info]
|
2409
2409
|
*
|
2410
2410
|
* @return self
|
2411
2411
|
*/
|
@@ -2417,6 +2417,7 @@ Info_initialize(VALUE self)
|
|
2417
2417
|
if (rb_proc_arity(rb_block_proc()) == 0)
|
2418
2418
|
{
|
2419
2419
|
// Run the block in self's context
|
2420
|
+
rb_warn("passing a block without an image argument is deprecated");
|
2420
2421
|
rb_obj_instance_eval(0, NULL, self);
|
2421
2422
|
}
|
2422
2423
|
else
|
data/ext/RMagick/rmmontage.c
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
* No Ruby usage (internal function)
|
23
23
|
*
|
24
24
|
* Notes:
|
25
|
-
* - If the Magick::Montage#texture method wrote a texture file, the file is
|
25
|
+
* - If the Magick::ImageList::Montage#texture method wrote a texture file, the file is
|
26
26
|
* deleted here.
|
27
27
|
*
|
28
28
|
* @param obj the montage object
|
@@ -73,7 +73,7 @@ Montage_alloc(VALUE class)
|
|
73
73
|
|
74
74
|
if (!montage_info)
|
75
75
|
{
|
76
|
-
rb_raise(rb_eNoMemError, "not enough memory to initialize Magick::Montage object");
|
76
|
+
rb_raise(rb_eNoMemError, "not enough memory to initialize Magick::ImageList::Montage object");
|
77
77
|
}
|
78
78
|
|
79
79
|
montage = ALLOC(Montage);
|
@@ -439,11 +439,11 @@ Montage_title_eq(VALUE self, VALUE title)
|
|
439
439
|
|
440
440
|
|
441
441
|
/**
|
442
|
-
* Return a new Magick::Montage object.
|
442
|
+
* Return a new Magick::ImageList::Montage object.
|
443
443
|
*
|
444
444
|
* No Ruby usage (internal function)
|
445
445
|
*
|
446
|
-
* @return a new Magick::Montage object
|
446
|
+
* @return a new Magick::ImageList::Montage object
|
447
447
|
*/
|
448
448
|
VALUE
|
449
449
|
rm_montage_new(void)
|
data/ext/RMagick/rmpixel.c
CHANGED
@@ -172,7 +172,7 @@ VALUE
|
|
172
172
|
Pixel_alpha_eq(VALUE self, VALUE v)
|
173
173
|
{
|
174
174
|
Pixel *pixel;
|
175
|
-
|
175
|
+
|
176
176
|
rb_check_frozen(self);
|
177
177
|
Data_Get_Struct(self, Pixel, pixel);
|
178
178
|
#if defined(IMAGEMAGICK_7)
|
@@ -381,8 +381,8 @@ Color_to_PixelColor(PixelColor *pp, VALUE color)
|
|
381
381
|
pp->green = pixel->green;
|
382
382
|
pp->blue = pixel->blue;
|
383
383
|
#if defined(IMAGEMAGICK_7)
|
384
|
-
pp->alpha = pixel->alpha;
|
385
384
|
pp->black = pixel->black;
|
385
|
+
rm_set_pixelinfo_alpha(pp, pixel->alpha);
|
386
386
|
#else
|
387
387
|
pp->opacity = pixel->opacity;
|
388
388
|
#endif
|
data/ext/RMagick/rmstruct.c
CHANGED
@@ -285,7 +285,7 @@ Export_ColorInfo(ColorInfo *ci, VALUE st)
|
|
285
285
|
ci->color.green = (MagickRealType) pixel.green;
|
286
286
|
ci->color.blue = (MagickRealType) pixel.blue;
|
287
287
|
#if defined(IMAGEMAGICK_7)
|
288
|
-
ci->color
|
288
|
+
rm_set_pixelinfo_alpha(&ci->color, (MagickRealType) OpaqueAlpha);
|
289
289
|
#else
|
290
290
|
ci->color.opacity = (MagickRealType) OpaqueOpacity;
|
291
291
|
#endif
|
@@ -760,7 +760,7 @@ Import_SegmentInfo(SegmentInfo *segment)
|
|
760
760
|
RB_GC_GUARD(y1);
|
761
761
|
RB_GC_GUARD(x2);
|
762
762
|
RB_GC_GUARD(y2);
|
763
|
-
|
763
|
+
|
764
764
|
return rb_funcall(Class_Segment, rm_ID_new, 4, x1, y1, x2, y2);
|
765
765
|
}
|
766
766
|
|
data/ext/RMagick/rmutil.c
CHANGED
@@ -858,6 +858,25 @@ rm_magick_error(const char *msg)
|
|
858
858
|
RB_GC_GUARD(mesg);
|
859
859
|
}
|
860
860
|
|
861
|
+
#if defined(IMAGEMAGICK_7)
|
862
|
+
/**
|
863
|
+
* Sets the alpha channel of a pixel color
|
864
|
+
*
|
865
|
+
* No Ruby usage (internal function)
|
866
|
+
*
|
867
|
+
* @param pixel the Pixel
|
868
|
+
* @param value the value
|
869
|
+
*/
|
870
|
+
void
|
871
|
+
rm_set_pixelinfo_alpha(PixelInfo *pixel, const MagickRealType value)
|
872
|
+
{
|
873
|
+
pixel->alpha = value;
|
874
|
+
if (value != (MagickRealType) OpaqueAlpha)
|
875
|
+
{
|
876
|
+
pixel->alpha_trait = BlendPixelTrait;
|
877
|
+
}
|
878
|
+
}
|
879
|
+
#endif
|
861
880
|
|
862
881
|
/**
|
863
882
|
* Initialize a new ImageMagickError object - store the "loc" string in the
|
@@ -1008,6 +1027,7 @@ rm_get_optional_arguments(VALUE img)
|
|
1008
1027
|
|
1009
1028
|
if (rb_proc_arity(rb_block_proc()) == 0)
|
1010
1029
|
{
|
1030
|
+
rb_warn("passing a block without an image argument is deprecated");
|
1011
1031
|
rb_obj_instance_eval(0, NULL, opt_args);
|
1012
1032
|
}
|
1013
1033
|
else
|
data/lib/rmagick/version.rb
CHANGED
data/lib/rvg/rvg.rb
CHANGED
@@ -85,7 +85,7 @@ module Magick
|
|
85
85
|
@background_image.change_geometry(Magick::Geometry.new(width, height)) do |new_cols, new_rows|
|
86
86
|
bg_image = @background_image.resize(new_cols, new_rows)
|
87
87
|
if bg_image.columns != width || bg_image.rows != height
|
88
|
-
bg = Magick::Image.new(width, height) {
|
88
|
+
bg = Magick::Image.new(width, height) { |options| options.background_color = bgcolor }
|
89
89
|
bg_image = bg.composite!(bg_image, Magick::CenterGravity, Magick::OverCompositeOp)
|
90
90
|
end
|
91
91
|
bg_image
|
@@ -96,7 +96,7 @@ module Magick
|
|
96
96
|
end
|
97
97
|
else
|
98
98
|
bgcolor = bgfill
|
99
|
-
canvas = Magick::Image.new(Integer(@width), Integer(@height)) {
|
99
|
+
canvas = Magick::Image.new(Integer(@width), Integer(@height)) { |options| options.background_color = bgcolor }
|
100
100
|
end
|
101
101
|
canvas[:desc] = @desc if @desc
|
102
102
|
canvas[:title] = @title if @title
|
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: 4.2.
|
4
|
+
version: 4.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Hunter
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-
|
14
|
+
date: 2021-10-10 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: pry
|
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
220
|
version: '0'
|
221
221
|
requirements:
|
222
222
|
- ImageMagick 6.7.7 or later
|
223
|
-
rubygems_version: 3.
|
223
|
+
rubygems_version: 3.2.22
|
224
224
|
signing_key:
|
225
225
|
specification_version: 4
|
226
226
|
summary: Ruby binding to ImageMagick
|