rmagick 5.2.0 → 5.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63297d93ba6355721cf93286469d8f1d278d553ca80b1c85fa5cefbc50f4217f
4
- data.tar.gz: 7d416384fa378aa68c2f16c980e41c63d932a805e488c7cb2bc987c974262736
3
+ metadata.gz: cb6efb1cd1084ddfa7fcf81fa760b652ff8c2cf02609da08744931b71bfa5af9
4
+ data.tar.gz: 66a715d679ea9114f0525cdd5ee60643b8fb84f9f96548a1d82a27e8fc9d0821
5
5
  SHA512:
6
- metadata.gz: 2f03de2614b1b8321b6a26a01e47cbf625455c4bfc5e88c9ae3354bf933d66a63fee9b9205c8a7d72893672e15bb8933bcb2cb8915074e702d74876c4c1c742f
7
- data.tar.gz: f9fa937f718148d007962a0b6e2f6588cc157d9a4998fccd942a5c8ac3066ca04bf8e60b79067abe5ee0c2402621cdb571287dca72ecdc6bc45625303ec71dfc
6
+ metadata.gz: '057860ced79ea3612eaae3df6840c57833da74b4eb25ddca45da7d40bf6577cbc6288b1a807dc9c9f8aeb6b0a652f3fe13007166fac2094ec9e75b59e170adf4'
7
+ data.tar.gz: df562bbda78354a5b595c2494ce6971b6a51c068df580cebd22c9accfb99c73f12ecaf55ab8c9b4f7f25a2cd05530a9b53af77fc29791ee9825bd6ef6b82320a
@@ -4,7 +4,7 @@
4
4
  "dockerfile": "../Dockerfile",
5
5
  "args": {
6
6
  "RUBY_VERSION": "3.1.2",
7
- "IMAGEMAGICK_VERSION": "6.9.12-59"
7
+ "IMAGEMAGICK_VERSION": "6.9.12-85"
8
8
  }
9
9
  },
10
10
  "onCreateCommand": "/setup/setup-repo.sh"
@@ -4,7 +4,7 @@
4
4
  "dockerfile": "Dockerfile",
5
5
  "args": {
6
6
  "RUBY_VERSION": "3.1.2",
7
- "IMAGEMAGICK_VERSION": "7.1.0-55"
7
+ "IMAGEMAGICK_VERSION": "7.1.1-7"
8
8
  }
9
9
  },
10
10
  "onCreateCommand": "/setup/setup-repo.sh"
@@ -34,13 +34,20 @@ jobs:
34
34
  imagemagick-version:
35
35
  - { full: 6.7.7-10, major-minor: '6.7' }
36
36
  - { full: 6.8.9-10, major-minor: '6.8' }
37
- - { full: 6.9.12-70, major-minor: '6.9' }
37
+ - { full: 6.9.12-85, major-minor: '6.9' }
38
38
  - { full: 7.0.11-14, major-minor: '7.0' }
39
- - { full: 7.1.0-55, major-minor: '7.1' }
39
+ - { full: 7.1.1-7, major-minor: '7.1' }
40
40
 
41
41
  name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
42
42
  steps:
43
43
  - uses: actions/checkout@v3
44
+ - name: Cache ImageMagick built objects
45
+ uses: actions/cache@v3
46
+ with:
47
+ path: ./build-ImageMagick
48
+ key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
49
+ restore-keys: |
50
+ v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
44
51
  - name: Set up Ruby ${{ matrix.ruby-version }}
45
52
  uses: ruby/setup-ruby@master
46
53
  with:
@@ -61,13 +68,20 @@ jobs:
61
68
  matrix:
62
69
  ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
63
70
  imagemagick-version:
64
- - { full: 6.9.12-70, major-minor: '6.9' }
71
+ - { full: 6.9.12-85, major-minor: '6.9' }
65
72
  - { full: 7.0.11-14, major-minor: '7.0' }
66
- - { full: 7.1.0-55, major-minor: '7.1' }
73
+ - { full: 7.1.1-7, major-minor: '7.1' }
67
74
 
68
75
  name: macOS, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
69
76
  steps:
70
77
  - uses: actions/checkout@v3
78
+ - name: Cache ImageMagick built objects
79
+ uses: actions/cache@v3
80
+ with:
81
+ path: ./build-ImageMagick
82
+ key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
83
+ restore-keys: |
84
+ v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
71
85
  - name: Set up Ruby ${{ matrix.ruby-version }}
72
86
  uses: ruby/setup-ruby@master
73
87
  with:
@@ -79,3 +93,46 @@ jobs:
79
93
  run: |
80
94
  bundle install --path=vendor/bundle --jobs 4 --retry 3
81
95
  bundle exec rake
96
+
97
+ test-windows:
98
+ runs-on: windows-latest
99
+ timeout-minutes: 20
100
+ strategy:
101
+ matrix:
102
+ ruby-version: ['3.2']
103
+ imagemagick-version:
104
+ - { full: 6.9.12-85, major-minor: '6.9' }
105
+ - { full: 7.1.1-7, major-minor: '7.1' }
106
+ env:
107
+ bundled_im_dir: C:\Program Files\ImageMagick-7.1.1-Q16-HDRI
108
+ install_im_dir: D:\ImageMagick
109
+
110
+ name: MSWin, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
111
+ steps:
112
+ - uses: actions/checkout@v3
113
+ - name: Setup environment variable
114
+ # https://stackoverflow.com/questions/60169752/how-to-update-the-path-in-a-github-action-workflow-file-for-a-windows-latest-hos
115
+ run: |
116
+ Add-Content $env:GITHUB_PATH ${{ env.install_im_dir }}
117
+ - name: Uninstall bundled ImageMagick
118
+ # Bundled ImageMagick does not have C/C++ library and dll which required by rmagick.
119
+ run: |
120
+ Start-Process -FilePath "${{ env.bundled_im_dir }}\unins000.exe" -ArgumentList "/VERYSILENT /NORESTART"
121
+ - name: Set up Ruby ${{ matrix.ruby-version }}
122
+ uses: ruby/setup-ruby@master
123
+ with:
124
+ ruby-version: ${{ matrix.ruby-version }}
125
+ - name: Install ghostscript
126
+ run: |
127
+ choco install ghostscript
128
+ - name: Install ImageMagick
129
+ # https://github.com/rmagick/ImageMagick-binaries
130
+ run: |
131
+ $imagemagick_version = "${{ matrix.imagemagick-version.full }}"
132
+ $installer_name = "ImageMagick-$($imagemagick_version)-Q16-x64-dll.exe"
133
+ $url = "https://github.com/rmagick/ImageMagick-binaries/raw/main/$($installer_name)"
134
+ Invoke-WebRequest -Uri $url -OutFile $installer_name
135
+ Start-Process -FilePath $installer_name -ArgumentList "/DIR=${{ env.install_im_dir }} /VERYSILENT /NORESTART /TASKS=install_Devel"
136
+ - name: Build and test with Rake
137
+ run: |
138
+ cmd.exe /D /S /C "bundle install --path=vendor/bundle --retry 3 & bundle exec rake"
data/.gitignore CHANGED
@@ -23,3 +23,5 @@ tmp
23
23
  Makefile
24
24
  extconf.h
25
25
  build-ImageMagick/
26
+ doc/node_modules/
27
+ doc/package-lock.json
data/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
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 5.3.0
7
+
8
+ Improvements
9
+
10
+ - Support GC compaction (#1388)
11
+
12
+ Bug Fixes
13
+
14
+ - Fix memory leak in `Magick::Draw` for recentry ImageMagick 6 by removing unnecessary `GetDrawInfo()` calling (#1406)
15
+ - Fix crash on ImageList#write with animation gif (#1379)
16
+ - Windows: Fix RubyInstaller::Runtime::DllDirectory::WinApiError (#1381)
17
+
6
18
  ## RMagick 5.2.0
7
19
 
8
20
  Improvements
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  RMagick
2
2
  =======
3
3
 
4
- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/901780ea1a244a8584b18033b2e03866)](https://app.codacy.com/gh/rmagick/rmagick?utm_source=github.com&utm_medium=referral&utm_content=rmagick/rmagick&utm_campaign=Badge_Grade_Settings)
5
4
  [![GemVersion](https://img.shields.io/gem/v/rmagick.svg?style=flat)](https://rubygems.org/gems/rmagick)
6
5
  ![CI](https://github.com/rmagick/rmagick/workflows/CI/badge.svg)
7
6
 
@@ -105,7 +104,7 @@ brew install imagemagick@6
105
104
  2. You might need to configure `PATH` environment variable to where the compiler is located.
106
105
  (Ex: `set PATH=C:\Ruby27-x64\msys64\usr\bin;C:\Ruby27-x64\msys64\mingw64\bin;%PATH%`)
107
106
  3. Download `ImageMagick-7.XXXX-Q16-x64-dll.exe` (not, `ImageMagick-7.XXXX-Q16-x64-static.exe`) binary from [Windows Binary Release](https://imagemagick.org/script/download.php#windows), or you can download ImageMagick 6 from [Windows Binary Release](https://legacy.imagemagick.org/script/download.php#windows).
108
- 4. Install ImageMagick. You need to turn on checkboxes `Add application directory to your system path` and `Install development headers and librarries for C and C++` in an installer for RMagick.
107
+ 4. Install ImageMagick. You need to turn on checkboxes `Add application directory to your system path` and `Install development headers and libraries for C and C++` in an installer for RMagick.
109
108
  <img width="50%" src="https://user-images.githubusercontent.com/199156/77183472-b72cbd00-6b11-11ea-8b9a-247bc1f9d8b1.png" />
110
109
 
111
110
  Installing RMagick
@@ -24,7 +24,7 @@ sudo apt-get autoremove -y imagemagick* libmagick* --purge
24
24
  # install build tools, ImageMagick delegates
25
25
  sudo apt-get install -y build-essential libx11-dev libxext-dev zlib1g-dev \
26
26
  liblcms2-dev libpng-dev libjpeg-dev libfreetype6-dev libxml2-dev \
27
- libtiff5-dev libwebp-dev liblqr-1-0-dev vim gsfonts ghostscript ccache
27
+ libtiff5-dev libwebp-dev liblqr-1-0-dev vim gsfonts ghostscript
28
28
 
29
29
  if [ ! -d /usr/include/freetype ]; then
30
30
  # If `/usr/include/freetype` is not existed, ImageMagick 6.7 configuration fails about Freetype.
@@ -52,7 +52,7 @@ build_imagemagick() {
52
52
  fi
53
53
 
54
54
  cd "${build_dir}"
55
- CC="ccache cc" CXX="ccache c++" ./configure --prefix=/usr "${options}"
55
+ ./configure --prefix=/usr "${options}"
56
56
  make -j
57
57
  }
58
58
 
@@ -17,10 +17,10 @@ fi
17
17
 
18
18
  export HOMEBREW_NO_AUTO_UPDATE=true
19
19
  brew uninstall --force imagemagick imagemagick@6
20
- brew install wget ghostscript freetype jpeg little-cms2 libomp libpng libtiff liblqr libtool zlib webp
20
+ brew install wget ghostscript freetype jpeg little-cms2 openexr libomp libpng libtiff liblqr libtool zlib webp
21
21
 
22
- export LDFLAGS="-L/usr/local/opt/libxml2/lib -L/usr/local/opt/zlib/lib"
23
- export CPPFLAGS="-I/usr/local/opt/libxml2/include -I/usr/local/opt/zlib/include"
22
+ export LDFLAGS="-L$(brew --prefix libxml2)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix glib)/lib -L$(brew --prefix openexr)/lib"
23
+ export CPPFLAGS="-I$(brew --prefix libxml2)/include -I$(brew --prefix zlib)/include -I$(brew --prefix glib)/include/glib-2.0 -I$(brew --prefix glib)/lib/glib-2.0/include -I$(brew --prefix openexr)/include/OpenEXR"
24
24
 
25
25
  project_dir=$(pwd)
26
26
  build_dir="${project_dir}/build-ImageMagick/ImageMagick-${IMAGEMAGICK_VERSION}"
@@ -360,7 +360,8 @@ module RMagick
360
360
 
361
361
  def create_header_file
362
362
  ruby_api = [
363
- 'rb_gc_adjust_memory_usage' # Ruby 2.4.0
363
+ 'rb_gc_adjust_memory_usage', # Ruby 2.4.0
364
+ 'rb_gc_mark_movable' # Ruby 2.7.0
364
365
  ]
365
366
  memory_api = %w[
366
367
  posix_memalign
data/ext/RMagick/rmdraw.c CHANGED
@@ -13,6 +13,9 @@
13
13
  #include "rmagick.h"
14
14
  #include "float.h"
15
15
 
16
+ #ifdef HAVE_RB_GC_MARK_MOVABLE
17
+ static void Draw_compact(void *drawptr);
18
+ #endif
16
19
  static void Draw_mark(void *);
17
20
  static void Draw_destroy(void *);
18
21
  static size_t Draw_memsize(const void *);
@@ -21,7 +24,14 @@ static VALUE get_type_metrics(int, VALUE *, VALUE, gvl_function_t);
21
24
 
22
25
  const rb_data_type_t rm_draw_data_type = {
23
26
  "Magick::Draw",
24
- { Draw_mark, Draw_destroy, Draw_memsize, },
27
+ {
28
+ Draw_mark,
29
+ Draw_destroy,
30
+ Draw_memsize,
31
+ #ifdef HAVE_RB_GC_MARK_MOVABLE
32
+ Draw_compact,
33
+ #endif
34
+ },
25
35
  0, 0,
26
36
  RUBY_TYPED_FROZEN_SHAREABLE,
27
37
  };
@@ -1267,6 +1277,25 @@ Draw_primitive(VALUE self, VALUE primitive)
1267
1277
  return self;
1268
1278
  }
1269
1279
 
1280
+ #ifdef HAVE_RB_GC_MARK_MOVABLE
1281
+ /**
1282
+ * Compact the objects.
1283
+ *
1284
+ * No Ruby usage (internal function)
1285
+ *
1286
+ * @param drawptr pointer to a Draw object
1287
+ */
1288
+ static void
1289
+ Draw_compact(void *drawptr)
1290
+ {
1291
+ Draw *draw = (Draw *)drawptr;
1292
+
1293
+ if (draw->primitives != (VALUE)0)
1294
+ {
1295
+ draw->primitives = rb_gc_location(draw->primitives);
1296
+ }
1297
+ }
1298
+ #endif
1270
1299
 
1271
1300
  /**
1272
1301
  * Mark referenced objects.
@@ -1282,7 +1311,11 @@ Draw_mark(void *drawptr)
1282
1311
 
1283
1312
  if (draw->primitives != (VALUE)0)
1284
1313
  {
1314
+ #ifdef HAVE_RB_GC_MARK_MOVABLE
1315
+ rb_gc_mark_movable(draw->primitives);
1316
+ #else
1285
1317
  rb_gc_mark(draw->primitives);
1318
+ #endif
1286
1319
  }
1287
1320
  }
1288
1321
 
@@ -1387,8 +1420,6 @@ DrawOptions_initialize(VALUE self)
1387
1420
  rb_raise(rb_eNoMemError, "not enough memory to continue");
1388
1421
  }
1389
1422
 
1390
- GetDrawInfo(NULL, draw_options->info);
1391
-
1392
1423
  if (rb_block_given_p())
1393
1424
  {
1394
1425
  rb_yield(self);
@@ -1193,8 +1193,8 @@ ImageList_write(VALUE self, VALUE file)
1193
1193
 
1194
1194
  // Ensure file is open - raise error if not
1195
1195
  GetOpenFile(file, fptr);
1196
- #if defined(_WIN32)
1197
1196
  add_format_prefix(info, fptr->pathv);
1197
+ #if defined(_WIN32)
1198
1198
  SetImageInfoFile(info, NULL);
1199
1199
  #else
1200
1200
  SetImageInfoFile(info, rb_io_stdio_file(fptr));
@@ -1229,7 +1229,7 @@ ImageList_write(VALUE self, VALUE file)
1229
1229
  #endif
1230
1230
 
1231
1231
  // Tell WriteImage if we want a multi-images file.
1232
- if (imagelist_length(self) > 1L && GetMagickAdjoin(m))
1232
+ if (imagelist_length(self) > 1L && m && GetMagickAdjoin(m))
1233
1233
  {
1234
1234
  info->adjoin = MagickTrue;
1235
1235
  }
@@ -15804,6 +15804,10 @@ void add_format_prefix(Info *info, VALUE file)
15804
15804
  char *p;
15805
15805
 
15806
15806
  // Convert arg to string. If an exception occurs raise an error condition.
15807
+ if (rb_respond_to(file, rb_intern("path")))
15808
+ {
15809
+ FilePathStringValue(file);
15810
+ }
15807
15811
  file = rb_rescue(rb_String, file, file_arg_rescue, file);
15808
15812
 
15809
15813
  filename = rm_str2cstr(file, &filename_l);
@@ -15899,21 +15903,19 @@ Image_write(VALUE self, VALUE file)
15899
15903
  // Ensure file is open - raise error if not
15900
15904
  GetOpenFile(file, fptr);
15901
15905
  rb_io_check_writable(fptr);
15902
- #if defined(_WIN32)
15903
15906
  add_format_prefix(info, fptr->pathv);
15904
- strlcpy(image->filename, info->filename, sizeof(image->filename));
15907
+ #if defined(_WIN32)
15905
15908
  SetImageInfoFile(info, NULL);
15906
15909
  #else
15907
15910
  SetImageInfoFile(info, rb_io_stdio_file(fptr));
15908
- memset(image->filename, 0, sizeof(image->filename));
15909
15911
  #endif
15910
15912
  }
15911
15913
  else
15912
15914
  {
15913
15915
  add_format_prefix(info, file);
15914
- strlcpy(image->filename, info->filename, sizeof(image->filename));
15915
15916
  SetImageInfoFile(info, NULL);
15916
15917
  }
15918
+ strlcpy(image->filename, info->filename, sizeof(image->filename));
15917
15919
 
15918
15920
  rm_sync_image_options(image, info);
15919
15921
 
data/ext/RMagick/rmmain.c CHANGED
@@ -1924,8 +1924,7 @@ version_constants(void)
1924
1924
  "This is %s ($Date: 2009/12/20 02:33:33 $) Copyright (C) 2009 by Timothy P. Hunter\n"
1925
1925
  "Built with %s\n"
1926
1926
  "Built for %s\n"
1927
- "Web page: http://rmagick.rubyforge.org\n"
1928
- "Email: rmagick@rubyforge.org\n",
1927
+ "Web page: https://rmagick.github.io/\n",
1929
1928
  Q(RMAGICK_VERSION_STRING), mgk_version, Q(RUBY_VERSION_STRING));
1930
1929
 
1931
1930
  str = rb_str_new2(long_version);
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Magick
4
- VERSION = '5.2.0'
4
+ VERSION = '5.3.0'
5
5
  MIN_RUBY_VERSION = '2.3.0'
6
6
  MIN_IM_VERSION = '6.7.7'
7
7
  end
@@ -14,7 +14,7 @@ if RUBY_PLATFORM =~ /mingw/i
14
14
  begin
15
15
  require 'ruby_installer'
16
16
  ENV['PATH'].split(File::PATH_SEPARATOR).grep(/ImageMagick/i).each do |path|
17
- RubyInstaller::Runtime.add_dll_directory(path)
17
+ RubyInstaller::Runtime.add_dll_directory(path) if File.exist?(File.join(path, 'CORE_RL_magick_.dll')) || File.exist?(File.join(path, 'CORE_RL_MagickCore_.dll'))
18
18
  end
19
19
  rescue LoadError
20
20
  end
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: 5.2.0
4
+ version: 5.3.0
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: 2023-03-12 00:00:00.000000000 Z
14
+ date: 2023-07-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: pkg-config
@@ -160,7 +160,6 @@ extensions:
160
160
  - ext/RMagick/extconf.rb
161
161
  extra_rdoc_files: []
162
162
  files:
163
- - ".codeclimate.yml"
164
163
  - ".devcontainer/Dockerfile"
165
164
  - ".devcontainer/ImageMagick6/devcontainer.json"
166
165
  - ".devcontainer/devcontainer.json"
@@ -238,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
237
  version: '0'
239
238
  requirements:
240
239
  - ImageMagick 6.7.7 or later
241
- rubygems_version: 3.4.2
240
+ rubygems_version: 3.4.1
242
241
  signing_key:
243
242
  specification_version: 4
244
243
  summary: Ruby binding to ImageMagick
data/.codeclimate.yml DELETED
@@ -1,63 +0,0 @@
1
- engines:
2
- cppcheck:
3
- enabled: true
4
- checks:
5
- variableScope:
6
- enabled: false
7
- toomanyconfigs:
8
- enabled: false
9
- invalidPrintfArgType_sint:
10
- enabled: false
11
- redundantAssignment:
12
- enabled: false
13
- selfAssignment:
14
- enabled: false
15
- unreachableCode:
16
- enabled: false
17
- unsignedLessThanZero:
18
- enabled: false
19
- toomanyconfigs:
20
- enabled: false
21
- complex-definition:
22
- enabled: false
23
-
24
- markdownlint:
25
- enabled: true
26
- checks:
27
- # Line length
28
- MD013:
29
- enabled: false
30
- # Emphasis used instead of a header
31
- MD036:
32
- enabled: false
33
- # Hard tabs
34
- MD010:
35
- enabled: false
36
- # Dollar signs used before commands without showing output
37
- MD014:
38
- enabled: false
39
- # Headers should be surrounded by blank lines
40
- MD022:
41
- enabled: false
42
- # Multiple consecutive blank lines
43
- MD012:
44
- enabled: false
45
- # Bare URL used
46
- MD034:
47
- enabled: false
48
- # Ordered list item prefix
49
- MD029:
50
- enabled: false
51
- # Lists should be surrounded by blank lines
52
- MD032:
53
- enabled: false
54
- # Code block style
55
- MD046:
56
- enabled: false
57
- # Header style
58
- MD003:
59
- enabled: false
60
- # Spaces after list markers
61
- MD030:
62
- enabled: false
63
-