rmagick 7.0.0 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/ext/RMagick/extconf.rb +1 -1
- data/ext/RMagick/rmimage.cpp +26 -11
- data/ext/RMagick/rmkinfo.cpp +10 -1
- data/ext/RMagick/rmmain.cpp +7 -0
- data/lib/rmagick/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '08ddd337d97e120559c7795dd051433b1453f7c420777083bf0ba29c094659b2'
|
|
4
|
+
data.tar.gz: 06e68a270014d1a93bc4873723e82f2a83144086d33c3329ff583ea357694af4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8b21f2dacdd58215e7fdfe7cce5c057280c8450d77fdab2b5e6bf48b2d5ba4995309b54054db4e06537ea6bc496b9e4126a2fe2462704caeaeec3be520ce94f5
|
|
7
|
+
data.tar.gz: 46e1f9816246476793cdf5f71c33abb794212a0d1935dcf81ec6a83aeb1a3668a6248cf1d7d8ad8993a758c3e129835f2cd8a4f5f5d2c0a695328a271869db29
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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 7.0.2
|
|
7
|
+
|
|
8
|
+
Bug Fixes
|
|
9
|
+
|
|
10
|
+
* Fix missing error check in KernelInfo#clone (#1794)
|
|
11
|
+
* Fix memory leak in Image#gamma_correct (#1793)
|
|
12
|
+
* Fix memory leak in Image#{color_profile=, iptc_profile=} when out of memory (#1792)
|
|
13
|
+
* Fix memory leaks if level operations fail in Image#{level_colors, levelize_channel} (#1791)
|
|
14
|
+
* Clean up ImageMagick resources on exit to fix ruby_memcheck false leaks (#1790)
|
|
15
|
+
|
|
16
|
+
## RMagick 7.0.1
|
|
17
|
+
|
|
18
|
+
Bug Fixes
|
|
19
|
+
|
|
20
|
+
* Image_gray_q changes the colour space of the image, instead of returning whether it's grayscale (#1788)
|
|
21
|
+
* Check for errors from ParseGeometry() (#1786)
|
|
22
|
+
* Fail explicitly when trying to install on JRuby (#1784)
|
|
23
|
+
|
|
6
24
|
## RMagick 7.0.0
|
|
7
25
|
|
|
8
26
|
Breaking Changes
|
data/ext/RMagick/extconf.rb
CHANGED
|
@@ -42,6 +42,7 @@ module RMagick
|
|
|
42
42
|
def initialize
|
|
43
43
|
@stdout = $stdout.dup
|
|
44
44
|
|
|
45
|
+
exit_failure("JRuby is not supported.\nSee https://github.com/jruby/jruby/wiki/C-Extension-Alternatives") if RUBY_ENGINE == 'jruby'
|
|
45
46
|
exit_failure("No longer support MSWIN environment.") if RUBY_PLATFORM.include?('mswin')
|
|
46
47
|
|
|
47
48
|
setup_pkg_config_path
|
|
@@ -283,7 +284,6 @@ module RMagick
|
|
|
283
284
|
_aligned_msize
|
|
284
285
|
]
|
|
285
286
|
imagemagick_api = [
|
|
286
|
-
'SetImageGray', # 6.9.1-10
|
|
287
287
|
'SetMagickAlignedMemoryMethods' # 7.0.9-0
|
|
288
288
|
]
|
|
289
289
|
|
data/ext/RMagick/rmimage.cpp
CHANGED
|
@@ -2930,6 +2930,7 @@ set_profile(VALUE self, const char *name, VALUE profile)
|
|
|
2930
2930
|
info = CloneImageInfo(NULL);
|
|
2931
2931
|
if (!info)
|
|
2932
2932
|
{
|
|
2933
|
+
DestroyExceptionInfo(exception);
|
|
2933
2934
|
rb_raise(rb_eNoMemError, "not enough memory to continue");
|
|
2934
2935
|
}
|
|
2935
2936
|
|
|
@@ -7646,7 +7647,7 @@ Image_gamma_correct(int argc, VALUE *argv, VALUE self)
|
|
|
7646
7647
|
}
|
|
7647
7648
|
|
|
7648
7649
|
#if defined(IMAGEMAGICK_7)
|
|
7649
|
-
|
|
7650
|
+
rm_check_exception(exception, new_image, DestroyOnError);
|
|
7650
7651
|
DestroyExceptionInfo(exception);
|
|
7651
7652
|
#else
|
|
7652
7653
|
rm_check_image_exception(new_image, DestroyOnError);
|
|
@@ -7929,6 +7930,13 @@ has_image_attribute(VALUE self, MagickBooleanType (attr_test)(const Image *))
|
|
|
7929
7930
|
}
|
|
7930
7931
|
#endif
|
|
7931
7932
|
|
|
7933
|
+
static MagickBooleanType
|
|
7934
|
+
Image_is_gray_colorspace_type(const Image *image, ExceptionInfo *exception)
|
|
7935
|
+
{
|
|
7936
|
+
ColorspaceType colorspace = GetImageColorspaceType(image, exception);
|
|
7937
|
+
return (colorspace == GRAYColorspace || colorspace == LinearGRAYColorspace) ? MagickTrue : MagickFalse;
|
|
7938
|
+
}
|
|
7939
|
+
|
|
7932
7940
|
|
|
7933
7941
|
/**
|
|
7934
7942
|
* Return true if all the pixels in the image have the same red, green, and blue intensities.
|
|
@@ -7938,11 +7946,7 @@ has_image_attribute(VALUE self, MagickBooleanType (attr_test)(const Image *))
|
|
|
7938
7946
|
VALUE
|
|
7939
7947
|
Image_gray_q(VALUE self)
|
|
7940
7948
|
{
|
|
7941
|
-
|
|
7942
|
-
return has_attribute(self, (MagickBooleanType (*)(const Image *, ExceptionInfo *))SetImageGray);
|
|
7943
|
-
#else
|
|
7944
|
-
return has_attribute(self, IsGrayImage);
|
|
7945
|
-
#endif
|
|
7949
|
+
return has_attribute(self, Image_is_gray_colorspace_type);
|
|
7946
7950
|
}
|
|
7947
7951
|
|
|
7948
7952
|
|
|
@@ -8672,6 +8676,7 @@ Image_level_colors(int argc, VALUE *argv, VALUE self)
|
|
|
8672
8676
|
#endif
|
|
8673
8677
|
if (!okay)
|
|
8674
8678
|
{
|
|
8679
|
+
DestroyImage(new_image);
|
|
8675
8680
|
rb_raise(rb_eRuntimeError, "LevelImageColors failed for unknown reason.");
|
|
8676
8681
|
}
|
|
8677
8682
|
|
|
@@ -8753,6 +8758,7 @@ Image_levelize_channel(int argc, VALUE *argv, VALUE self)
|
|
|
8753
8758
|
|
|
8754
8759
|
if (!okay)
|
|
8755
8760
|
{
|
|
8761
|
+
DestroyImage(new_image);
|
|
8756
8762
|
rb_raise(rb_eRuntimeError, "LevelizeImageChannel failed for unknown reason.");
|
|
8757
8763
|
}
|
|
8758
8764
|
return rm_image_new(new_image);
|
|
@@ -11355,15 +11361,24 @@ Image_random_threshold_channel(int argc, VALUE *argv, VALUE self)
|
|
|
11355
11361
|
exception = AcquireExceptionInfo();
|
|
11356
11362
|
|
|
11357
11363
|
#if defined(IMAGEMAGICK_7)
|
|
11358
|
-
BEGIN_CHANNEL_MASK(new_image, channels);
|
|
11359
11364
|
{
|
|
11360
11365
|
GeometryInfo geometry_info;
|
|
11361
11366
|
|
|
11362
|
-
ParseGeometry(thresholds, &geometry_info)
|
|
11363
|
-
|
|
11364
|
-
|
|
11367
|
+
if (ParseGeometry(thresholds, &geometry_info) == NoValue && *thresholds)
|
|
11368
|
+
{
|
|
11369
|
+
(void) ThrowMagickException(exception, GetMagickModule(), OptionError,
|
|
11370
|
+
"InvalidArgument", "'%s'", thresholds);
|
|
11371
|
+
}
|
|
11372
|
+
else
|
|
11373
|
+
{
|
|
11374
|
+
BEGIN_CHANNEL_MASK(new_image, channels);
|
|
11375
|
+
{
|
|
11376
|
+
GVL_STRUCT_TYPE(RandomThresholdImage) args = { new_image, geometry_info.rho, geometry_info.sigma, exception };
|
|
11377
|
+
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(RandomThresholdImage), &args);
|
|
11378
|
+
}
|
|
11379
|
+
END_CHANNEL_MASK(new_image);
|
|
11380
|
+
}
|
|
11365
11381
|
}
|
|
11366
|
-
END_CHANNEL_MASK(new_image);
|
|
11367
11382
|
#else
|
|
11368
11383
|
GVL_STRUCT_TYPE(RandomThresholdImageChannel) args = { new_image, channels, thresholds, exception };
|
|
11369
11384
|
CALL_FUNC_WITHOUT_GVL(GVL_FUNC(RandomThresholdImageChannel), &args);
|
data/ext/RMagick/rmkinfo.cpp
CHANGED
|
@@ -162,6 +162,10 @@ VALUE
|
|
|
162
162
|
KernelInfo_clone(VALUE self)
|
|
163
163
|
{
|
|
164
164
|
KernelInfo *kernel = CloneKernelInfo((KernelInfo*)DATA_PTR(self));
|
|
165
|
+
if (!kernel)
|
|
166
|
+
{
|
|
167
|
+
rb_raise(rb_eNoMemError, "not enough memory to continue");
|
|
168
|
+
}
|
|
165
169
|
return TypedData_Wrap_Struct(Class_KernelInfo, &rm_kernel_info_data_type, kernel);
|
|
166
170
|
}
|
|
167
171
|
|
|
@@ -180,12 +184,17 @@ KernelInfo_builtin(VALUE self, VALUE what, VALUE geometry)
|
|
|
180
184
|
KernelInfo *kernel;
|
|
181
185
|
KernelInfoType kernel_type;
|
|
182
186
|
GeometryInfo info;
|
|
187
|
+
const char *geom_str;
|
|
183
188
|
#if defined(IMAGEMAGICK_7)
|
|
184
189
|
ExceptionInfo *exception;
|
|
185
190
|
#endif
|
|
186
191
|
|
|
187
192
|
VALUE_TO_ENUM(what, kernel_type, KernelInfoType);
|
|
188
|
-
|
|
193
|
+
geom_str = StringValueCStr(geometry);
|
|
194
|
+
if (ParseGeometry(geom_str, &info) == NoValue && *geom_str)
|
|
195
|
+
{
|
|
196
|
+
rb_raise(rb_eArgError, "invalid geometry string");
|
|
197
|
+
}
|
|
189
198
|
|
|
190
199
|
#if defined(IMAGEMAGICK_7)
|
|
191
200
|
exception = AcquireExceptionInfo();
|
data/ext/RMagick/rmmain.cpp
CHANGED
|
@@ -214,6 +214,12 @@ static void set_managed_memory(void)
|
|
|
214
214
|
|
|
215
215
|
|
|
216
216
|
|
|
217
|
+
static void
|
|
218
|
+
rmagick_terminus(VALUE unused)
|
|
219
|
+
{
|
|
220
|
+
MagickCoreTerminus();
|
|
221
|
+
}
|
|
222
|
+
|
|
217
223
|
/**
|
|
218
224
|
* Define the classes and constants.
|
|
219
225
|
*
|
|
@@ -231,6 +237,7 @@ Init_RMagick2(void)
|
|
|
231
237
|
set_managed_memory();
|
|
232
238
|
|
|
233
239
|
MagickCoreGenesis("RMagick", MagickFalse);
|
|
240
|
+
rb_set_end_proc(rmagick_terminus, Qnil);
|
|
234
241
|
|
|
235
242
|
test_Magick_version();
|
|
236
243
|
|
data/lib/rmagick/version.rb
CHANGED
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: 7.0.
|
|
4
|
+
version: 7.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tim Hunter
|
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
143
143
|
version: '0'
|
|
144
144
|
requirements:
|
|
145
145
|
- ImageMagick 6.9.0+ (for ImageMagick 6) or 7.1.0+ (for ImageMagick 7)
|
|
146
|
-
rubygems_version: 4.0.
|
|
146
|
+
rubygems_version: 4.0.10
|
|
147
147
|
specification_version: 4
|
|
148
148
|
summary: Ruby binding to ImageMagick
|
|
149
149
|
test_files: []
|