rmagick 4.2.4 → 4.2.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49c8cb7d9f379a29133d870ab4542f9e30c9f1828343c8dacc466b4795b86bb4
4
- data.tar.gz: b3c32bda2622044535255bd080cb16e0fe2d7101f74be85db077cf4057ca8c21
3
+ metadata.gz: cd92f37d8a01928beb9e4b44c7f7712dab8b2307c42484253b179e474d363e47
4
+ data.tar.gz: 1faa1f97938450f4199f3019c7b6848efc7cf4a4e43aa06d218c81fad82e21fe
5
5
  SHA512:
6
- metadata.gz: 7510f2cbddbccf9c2002b81e42409cf2b59eecf8768bae710ea81bfe5d773e948b841c995d9eca261d249808087ecc72ff4a93f183e5dd77eccef8fb4414224b
7
- data.tar.gz: 6570f951140ad45e61d09a8d9183a65f8e5c08d731ccce314c0e79e037c763d86d8bd7cb1f7dd88365e23da55a9b001e547d8004c4df74d0a4c3ff5d5c358d59
6
+ metadata.gz: 36585f543e7e3edb3f967524e8e6a498d0fb9059adb54e96652bb8ddf2772d51d43a183822dd32149fad24c48001de8073dfac9e7e4a3781fe1c8462c940407a
7
+ data.tar.gz: 19197353b30bf77c73267bf3d939149dc9e078938382d27e24cada606b0edf4c6c21fae0603d00742301a850f9a959f35fd86f1026b104ba342a990dfe887f9d
@@ -0,0 +1,14 @@
1
+ ARG RUBY_VERSION
2
+
3
+ FROM ruby:${RUBY_VERSION}
4
+
5
+ ARG IMAGEMAGICK_VERSION
6
+
7
+ RUN mkdir /setup
8
+ ADD *.sh /setup
9
+
10
+ ENV IMAGEMAGICK_VERSION ${IMAGEMAGICK_VERSION}
11
+
12
+ RUN /setup/setup-user.sh
13
+
14
+ WORKDIR /workspaces/rmagick
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "ImageMagick 6",
3
+ "build": {
4
+ "dockerfile": "../Dockerfile",
5
+ "args": {
6
+ "RUBY_VERSION": "3.1.2",
7
+ "IMAGEMAGICK_VERSION": "6.9.12-54"
8
+ }
9
+ },
10
+ "onCreateCommand": "/setup/setup-repo.sh"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "ImageMagick 7",
3
+ "build": {
4
+ "dockerfile": "../Dockerfile",
5
+ "args": {
6
+ "RUBY_VERSION": "3.1.2",
7
+ "IMAGEMAGICK_VERSION": "7.1.0-39"
8
+ }
9
+ },
10
+ "onCreateCommand": "/setup/setup-repo.sh"
11
+ }
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ apt-get update
5
+ apt-get install sudo
6
+
7
+ bash /workspaces/rmagick/before_install_linux.sh
8
+
9
+ cd /workspaces/rmagick
10
+ bundle install --path=vendor/bundle --jobs 4 --retry 3
@@ -0,0 +1,45 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ codespaces_bash="$(cat \
5
+ <<'EOF'
6
+ # Codespaces bash prompt theme
7
+ __bash_prompt() {
8
+ local userpart='`export XIT=$? \
9
+ && [ ! -z "${GITHUB_USER}" ] && echo -n "\[\033[0;32m\]@${GITHUB_USER} " || echo -n "\[\033[0;32m\]\u " \
10
+ && echo -n "\[\033[0;36m\][IM ${IMAGEMAGICK_VERSION}]" \
11
+ && [ "$XIT" -ne "0" ] && echo -n "\[\033[1;31m\]➜" || echo -n "\[\033[0m\]➜"`'
12
+ local gitbranch='`\
13
+ if [ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ]; then \
14
+ export BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD 2>/dev/null); \
15
+ if [ "${BRANCH}" != "" ]; then \
16
+ echo -n "\[\033[0;36m\](\[\033[1;31m\]${BRANCH}" \
17
+ && if git ls-files --error-unmatch -m --directory --no-empty-directory -o --exclude-standard ":/*" > /dev/null 2>&1; then \
18
+ echo -n " \[\033[1;33m\]✗"; \
19
+ fi \
20
+ && echo -n "\[\033[0;36m\]) "; \
21
+ fi; \
22
+ fi`'
23
+ local lightblue='\[\033[1;34m\]'
24
+ local removecolor='\[\033[0m\]'
25
+ PS1="${userpart} ${lightblue}\w ${gitbranch}${removecolor}\$ "
26
+ unset -f __bash_prompt
27
+ }
28
+ __bash_prompt
29
+
30
+ __show_notice() {
31
+ local __message="
32
+ \033[0;32mWelcome to Codespaces! You are using the pre-configured rmagick image.\033[0m
33
+
34
+ \033[0;35mTests can be executed with:\033[0m bundle exec rake
35
+ \033[0;35mCode style can be checked with:\033[0m STYLE_CHECKS=true bundle exec rubocop
36
+ "
37
+ echo -e "$__message"
38
+
39
+ unset -f __show_notice
40
+ }
41
+ __show_notice
42
+ EOF
43
+ )"
44
+
45
+ echo "${codespaces_bash}" >> "/root/.bashrc"
@@ -7,12 +7,15 @@ on:
7
7
  pull_request:
8
8
  workflow_dispatch:
9
9
 
10
+ permissions:
11
+ contents: read
12
+
10
13
  jobs:
11
14
  lint:
12
15
  runs-on: ubuntu-latest
13
16
  timeout-minutes: 20
14
17
  steps:
15
- - uses: actions/checkout@v2
18
+ - uses: actions/checkout@v3
16
19
  - name: Set up Ruby 2.3
17
20
  uses: ruby/setup-ruby@master
18
21
  with:
@@ -31,12 +34,12 @@ jobs:
31
34
  imagemagick-version:
32
35
  - { full: 6.7.7-10, major-minor: '6.7' }
33
36
  - { full: 6.8.9-10, major-minor: '6.8' }
34
- - { full: 6.9.12-29, major-minor: '6.9' }
35
- - { full: 7.1.0-14, major-minor: '7.0' }
37
+ - { full: 6.9.12-56, major-minor: '6.9' }
38
+ - { full: 7.1.0-41, major-minor: '7.0' }
36
39
 
37
40
  name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
38
41
  steps:
39
- - uses: actions/checkout@v2
42
+ - uses: actions/checkout@v3
40
43
  - name: Set up Ruby ${{ matrix.ruby-version }}
41
44
  uses: ruby/setup-ruby@master
42
45
  with:
@@ -57,12 +60,12 @@ jobs:
57
60
  matrix:
58
61
  ruby-version: ['2.6', '2.7', '3.0', '3.1']
59
62
  imagemagick-version:
60
- - { full: 6.9.12-29, major-minor: '6.9' }
61
- - { full: 7.1.0-14, major-minor: '7.0' }
63
+ - { full: 6.9.12-56, major-minor: '6.9' }
64
+ - { full: 7.1.0-41, major-minor: '7.0' }
62
65
 
63
66
  name: macOS, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
64
67
  steps:
65
- - uses: actions/checkout@v2
68
+ - uses: actions/checkout@v3
66
69
  - name: Set up Ruby ${{ matrix.ruby-version }}
67
70
  uses: ruby/setup-ruby@master
68
71
  with:
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 4.2.6
7
+
8
+ Improvements
9
+
10
+ - Remove test_files to reduce gem package size (#1338)
11
+
12
+ Bug Fixes
13
+
14
+ - Guard against an empty rpath (#1333)
15
+ - Call GetImageDistortion instead of IsImagesEqual to fix the issue reported in #1342 (#1343)
16
+
17
+ ## RMagick 4.2.5
18
+
19
+ Bug Fixes
20
+
21
+ - Specify rpath linker option to fix dynamic lib lookup failure on Linux (#1325)
22
+ - Fix Image#profile! that can't delete exif data (#1326)
23
+
6
24
  ## RMagick 4.2.4
7
25
 
8
26
  Improvements
data/README.md CHANGED
@@ -197,6 +197,8 @@ export LD_LIBRARY_PATH=/usr/local/lib
197
197
  On Linux, see `ld(1)` and `ld.so(8)` for more information. On other operating
198
198
  systems, see the documentation for the dynamic loading facility.
199
199
 
200
+ This operation might not be required when you can use 4.2.5 or later.
201
+
200
202
  ### Segmentation fault
201
203
 
202
204
  Default stack size of your operating system might be too small. Try removing
@@ -41,7 +41,7 @@ build_imagemagick() {
41
41
  mkdir -p build-ImageMagick
42
42
 
43
43
  version=(${IMAGEMAGICK_VERSION//./ })
44
- wget "https://imagemagick.org/download/releases/ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
44
+ wget "https://imagemagick.org/archive/releases/ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
45
45
  tar -xf "ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
46
46
  rm "ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
47
47
  mv "ImageMagick-${IMAGEMAGICK_VERSION}" "${build_dir}"
@@ -19,7 +19,7 @@ export HOMEBREW_NO_AUTO_UPDATE=true
19
19
  brew install wget pkg-config ghostscript freetype jpeg little-cms2 libomp libpng libtiff liblqr libtool libxml2 zlib webp
20
20
 
21
21
  export LDFLAGS="-L/usr/local/opt/libxml2/lib -L/usr/local/opt/zlib/lib"
22
- export CPPFLAGS="-I/usr/local/opt/libxml2/include/libxml2 -I/usr/local/opt/zlib/include"
22
+ export CPPFLAGS="-I/usr/local/opt/libxml2/include -I/usr/local/opt/zlib/include"
23
23
 
24
24
  project_dir=$(pwd)
25
25
  build_dir="${project_dir}/build-ImageMagick/ImageMagick-${IMAGEMAGICK_VERSION}"
@@ -31,7 +31,7 @@ build_imagemagick() {
31
31
  mkdir -p build-ImageMagick
32
32
 
33
33
  version=(${IMAGEMAGICK_VERSION//./ })
34
- wget "https://imagemagick.org/download/releases/ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
34
+ wget "https://imagemagick.org/archive/releases/ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
35
35
  tar -xf "ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
36
36
  rm "ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
37
37
  mv "ImageMagick-${IMAGEMAGICK_VERSION}" "${build_dir}"
@@ -67,10 +67,19 @@ module RMagick
67
67
  check_multiple_imagemagick_versions
68
68
  check_partial_imagemagick_versions
69
69
 
70
+ libdir = `pkg-config --libs-only-L #{$magick_package}`.chomp.sub('-L', '')
71
+ ldflags = "#{ENV['LDFLAGS']} " + `pkg-config --libs #{$magick_package}`.chomp
72
+ rpath = libdir.empty? ? '' : "-Wl,-rpath,#{libdir}"
73
+
70
74
  # Save flags
71
75
  $CPPFLAGS = "#{ENV['CPPFLAGS']} " + `pkg-config --cflags #{$magick_package}`.chomp
72
- $LDFLAGS = "#{ENV['LDFLAGS']} " + `pkg-config --libs #{$magick_package}`.chomp
73
76
  $LOCAL_LIBS = "#{ENV['LIBS']} " + `pkg-config --libs #{$magick_package}`.chomp
77
+ $LDFLAGS = "#{ldflags} #{rpath}"
78
+
79
+ unless try_link("int main() { }")
80
+ # if linker does not recognizes '-Wl,-rpath,somewhere' option, it revert to original option
81
+ $LDFLAGS = ldflags
82
+ end
74
83
 
75
84
  configure_archflags_for_osx($magick_package) if RUBY_PLATFORM =~ /darwin/ # osx
76
85
 
@@ -434,9 +434,9 @@ EXTERN unsigned long long rm_main_thread_id;
434
434
  #define R_boolean_to_C_boolean(attr) RTEST(attr) /**< C boolean <- Ruby boolean */
435
435
  #define C_int_to_R_int(attr) INT2FIX(attr) /**< C int -> Ruby int */
436
436
  #define R_int_to_C_int(attr) NUM2INT(attr) /**< C int <- Ruby int */
437
- #define C_long_to_R_long(attr) INT2NUM(attr) /**< C long -> Ruby long */
437
+ #define C_long_to_R_long(attr) LONG2NUM(attr) /**< C long -> Ruby long */
438
438
  #define R_long_to_C_long(attr) NUM2LONG(attr) /**< C long <- Ruby long */
439
- #define C_ulong_to_R_ulong(attr) UINT2NUM(attr) /**< C unsigned long -> Ruby unsigned long */
439
+ #define C_ulong_to_R_ulong(attr) ULONG2NUM(attr) /**< C unsigned long -> Ruby unsigned long */
440
440
  #define R_ulong_to_C_ulong(attr) NUM2ULONG(attr) /**< C unsigned long <- Ruby unsigned long */
441
441
  #define C_str_to_R_str(attr) attr ? rb_str_new2(attr) : Qnil /**< C string -> Ruby string */
442
442
  #define C_dbl_to_R_dbl(attr) rb_float_new(attr) /**< C double -> Ruby double */
@@ -5039,8 +5039,16 @@ VALUE
5039
5039
  Image_delete_profile(VALUE self, VALUE name)
5040
5040
  {
5041
5041
  Image *image = rm_check_frozen(self);
5042
- DeleteImageProfile(image, StringValueCStr(name));
5043
5042
 
5043
+ #if defined(IMAGEMAGICK_7)
5044
+ ExceptionInfo *exception = AcquireExceptionInfo();
5045
+
5046
+ ProfileImage(image, StringValueCStr(name), NULL, 0, exception);
5047
+ CHECK_EXCEPTION();
5048
+ DestroyExceptionInfo(exception);
5049
+ #else
5050
+ ProfileImage(image, StringValueCStr(name), NULL, 0, MagickTrue);
5051
+ #endif
5044
5052
  return self;
5045
5053
  }
5046
5054
 
@@ -5197,6 +5205,7 @@ Image_difference(VALUE self, VALUE other)
5197
5205
  Image *image2;
5198
5206
  VALUE mean, nmean, nmax;
5199
5207
  #if defined(IMAGEMAGICK_7)
5208
+ double distortion;
5200
5209
  ExceptionInfo *exception;
5201
5210
  #endif
5202
5211
 
@@ -5206,7 +5215,7 @@ Image_difference(VALUE self, VALUE other)
5206
5215
 
5207
5216
  #if defined(IMAGEMAGICK_7)
5208
5217
  exception = AcquireExceptionInfo();
5209
- IsImagesEqual(image, image2, exception);
5218
+ GetImageDistortion(image, image2, MeanErrorPerPixelErrorMetric, &distortion, exception);
5210
5219
  CHECK_EXCEPTION();
5211
5220
  DestroyExceptionInfo(exception);
5212
5221
  #else
@@ -672,10 +672,10 @@ Import_RectangleInfo(RectangleInfo *rect)
672
672
  VALUE height;
673
673
  VALUE x, y;
674
674
 
675
- width = UINT2NUM(rect->width);
676
- height = UINT2NUM(rect->height);
677
- x = INT2NUM(rect->x);
678
- y = INT2NUM(rect->y);
675
+ width = ULONG2NUM(rect->width);
676
+ height = ULONG2NUM(rect->height);
677
+ x = LONG2NUM(rect->x);
678
+ y = LONG2NUM(rect->y);
679
679
 
680
680
  RB_GC_GUARD(width);
681
681
  RB_GC_GUARD(height);
@@ -1,5 +1,5 @@
1
1
  module Magick
2
- VERSION = '4.2.4'
2
+ VERSION = '4.2.6'
3
3
  MIN_RUBY_VERSION = '2.3.0'
4
4
  MIN_IM_VERSION = '6.7.7'
5
5
  end
data/rmagick.gemspec CHANGED
@@ -15,18 +15,16 @@ Gem::Specification.new do |s|
15
15
 
16
16
  tracked_files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
17
17
  file_exclusion_regex = %r{\A(doc|benchmarks|examples|spec|lib/rvg/to_c.rb)}
18
- files = tracked_files.reject { |file| file[file_exclusion_regex] }
19
- test_files = files.grep(%r{^(test|spec|features)/})
18
+ files = tracked_files.reject { |file| file[file_exclusion_regex] }
20
19
 
21
- s.files = files
22
- s.test_files = test_files
20
+ s.files = files
23
21
  s.require_paths << 'ext' << 'deprecated'
24
22
 
25
23
  s.extensions = %w[ext/RMagick/extconf.rb]
26
24
  s.required_ruby_version = ">= #{Magick::MIN_RUBY_VERSION}"
27
25
  s.requirements << "ImageMagick #{Magick::MIN_IM_VERSION} or later"
28
26
 
29
- s.add_development_dependency 'pry', '~> 0.12.2'
27
+ s.add_development_dependency 'pry', '~> 0.14'
30
28
  s.add_development_dependency 'rake-compiler', '~> 1.0'
31
29
  s.add_development_dependency 'rspec', '~> 3.8'
32
30
  s.add_development_dependency 'rspec_junit_formatter', '~> 0.4.1'
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmagick
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.4
4
+ version: 4.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Hunter
8
8
  - Omer Bar-or
9
9
  - Benjamin Thomas
10
10
  - Moncef Maiza
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-12-26 00:00:00.000000000 Z
14
+ date: 2022-07-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: pry
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: 0.12.2
22
+ version: '0.14'
23
23
  type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 0.12.2
29
+ version: '0.14'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rake-compiler
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -147,6 +147,11 @@ extensions:
147
147
  extra_rdoc_files: []
148
148
  files:
149
149
  - ".codeclimate.yml"
150
+ - ".devcontainer/Dockerfile"
151
+ - ".devcontainer/ImageMagick6/devcontainer.json"
152
+ - ".devcontainer/ImageMagick7/devcontainer.json"
153
+ - ".devcontainer/setup-repo.sh"
154
+ - ".devcontainer/setup-user.sh"
150
155
  - ".editorconfig"
151
156
  - ".github/ISSUE_TEMPLATE.md"
152
157
  - ".github/workflows/ci.yml"
@@ -202,7 +207,7 @@ homepage: https://github.com/rmagick/rmagick
202
207
  licenses:
203
208
  - MIT
204
209
  metadata: {}
205
- post_install_message:
210
+ post_install_message:
206
211
  rdoc_options: []
207
212
  require_paths:
208
213
  - lib
@@ -221,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
226
  requirements:
222
227
  - ImageMagick 6.7.7 or later
223
228
  rubygems_version: 3.2.32
224
- signing_key:
229
+ signing_key:
225
230
  specification_version: 4
226
231
  summary: Ruby binding to ImageMagick
227
232
  test_files: []