rmagick 6.2.0 → 7.0.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 +4 -4
- data/CHANGELOG.md +27 -0
- data/Gemfile +3 -4
- data/README.md +49 -70
- data/Rakefile +1 -8
- data/ext/RMagick/extconf.rb +10 -8
- data/ext/RMagick/rmagick.cpp +6 -7
- data/ext/RMagick/rmagick.h +5 -18
- data/ext/RMagick/rmdraw.cpp +6 -7
- data/ext/RMagick/rmenum.cpp +5 -6
- data/ext/RMagick/rmfill.cpp +6 -8
- data/ext/RMagick/rmilist.cpp +6 -7
- data/ext/RMagick/rmimage.cpp +55 -109
- data/ext/RMagick/rminfo.cpp +6 -8
- data/ext/RMagick/rmkinfo.cpp +8 -7
- data/ext/RMagick/rmmain.cpp +7 -23
- data/ext/RMagick/rmmontage.cpp +6 -8
- data/ext/RMagick/rmpixel.cpp +6 -7
- data/ext/RMagick/rmstruct.cpp +8 -12
- data/ext/RMagick/rmutil.cpp +6 -27
- data/lib/rmagick/version.rb +4 -3
- data/lib/rmagick_internal.rb +30 -37
- data/lib/rvg/clippath.rb +3 -4
- data/lib/rvg/container.rb +3 -4
- data/lib/rvg/deep_equal.rb +3 -0
- data/lib/rvg/describable.rb +4 -5
- data/lib/rvg/embellishable.rb +7 -8
- data/lib/rvg/misc.rb +13 -12
- data/lib/rvg/paint.rb +3 -4
- data/lib/rvg/pathdata.rb +3 -4
- data/lib/rvg/rvg.rb +3 -29
- data/lib/rvg/stretchable.rb +4 -5
- data/lib/rvg/stylable.rb +4 -5
- data/lib/rvg/text.rb +9 -10
- data/lib/rvg/transformable.rb +3 -4
- data/lib/rvg/units.rb +3 -2
- data/rmagick.gemspec +6 -4
- data/sig/rmagick.rbs +2 -1
- metadata +4 -19
- data/.devcontainer/Dockerfile +0 -14
- data/.devcontainer/ImageMagick6/devcontainer.json +0 -11
- data/.devcontainer/devcontainer.json +0 -11
- data/.devcontainer/setup-repo.sh +0 -10
- data/.devcontainer/setup-user.sh +0 -45
- data/.editorconfig +0 -17
- data/.github/ISSUE_TEMPLATE/report.yml +0 -40
- data/.github/ISSUE_TEMPLATE.md +0 -17
- data/.github/workflows/ci.yml +0 -264
- data/.gitignore +0 -29
- data/.rspec +0 -2
- data/.rubocop.yml +0 -68
- data/.rubocop_todo.yml +0 -596
- data/before_install_linux.sh +0 -61
- data/before_install_osx.sh +0 -60
data/lib/rmagick_internal.rb
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
# Copyright (C) 2009 by Timothy P. Hunter
|
|
6
|
-
# Name: rmagick_internal.rb
|
|
7
|
-
# Author: Tim Hunter
|
|
8
|
-
# Purpose: Extend Ruby to interface with ImageMagick.
|
|
9
|
-
# Notes: RMagick2.so defines the classes. The code below adds methods
|
|
10
|
-
# to the classes.
|
|
11
|
-
#==============================================================================
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
12
5
|
|
|
13
6
|
if RUBY_PLATFORM.match?(/mingw/i)
|
|
14
7
|
require 'ruby_installer'
|
|
@@ -775,9 +768,9 @@ module Magick
|
|
|
775
768
|
|
|
776
769
|
# Provide an alternate version of Draw#annotate, for folks who
|
|
777
770
|
# want to find it in this class.
|
|
778
|
-
def annotate(draw, width, height, x, y, text, &
|
|
771
|
+
def annotate(draw, width, height, x, y, text, &)
|
|
779
772
|
check_destroyed
|
|
780
|
-
draw.annotate(self, width, height, x, y, text, &
|
|
773
|
+
draw.annotate(self, width, height, x, y, text, &)
|
|
781
774
|
self
|
|
782
775
|
end
|
|
783
776
|
|
|
@@ -1389,8 +1382,8 @@ module Magick
|
|
|
1389
1382
|
end
|
|
1390
1383
|
alias size length
|
|
1391
1384
|
|
|
1392
|
-
def sort!(*args, &
|
|
1393
|
-
@images.sort!(*args, &
|
|
1385
|
+
def sort!(*args, &)
|
|
1386
|
+
@images.sort!(*args, &)
|
|
1394
1387
|
self
|
|
1395
1388
|
end
|
|
1396
1389
|
|
|
@@ -1406,17 +1399,17 @@ module Magick
|
|
|
1406
1399
|
end
|
|
1407
1400
|
|
|
1408
1401
|
# override Enumerable#collect
|
|
1409
|
-
def collect(&
|
|
1402
|
+
def collect(&)
|
|
1410
1403
|
current = get_current
|
|
1411
|
-
a = @images.map(&
|
|
1404
|
+
a = @images.map(&)
|
|
1412
1405
|
ilist = self.class.new
|
|
1413
1406
|
a.each { |image| ilist << image }
|
|
1414
1407
|
ilist.set_current current
|
|
1415
1408
|
ilist
|
|
1416
1409
|
end
|
|
1417
1410
|
|
|
1418
|
-
def collect!(&
|
|
1419
|
-
@images.map!(&
|
|
1411
|
+
def collect!(&)
|
|
1412
|
+
@images.map!(&)
|
|
1420
1413
|
assert_image_array @images
|
|
1421
1414
|
self
|
|
1422
1415
|
end
|
|
@@ -1474,10 +1467,10 @@ module Magick
|
|
|
1474
1467
|
@images.each { |f| f.delay = Integer(d) }
|
|
1475
1468
|
end
|
|
1476
1469
|
|
|
1477
|
-
def delete(obj, &
|
|
1470
|
+
def delete(obj, &)
|
|
1478
1471
|
assert_image obj
|
|
1479
1472
|
current = get_current
|
|
1480
|
-
a = @images.delete(obj, &
|
|
1473
|
+
a = @images.delete(obj, &)
|
|
1481
1474
|
set_current current
|
|
1482
1475
|
a
|
|
1483
1476
|
end
|
|
@@ -1489,9 +1482,9 @@ module Magick
|
|
|
1489
1482
|
a
|
|
1490
1483
|
end
|
|
1491
1484
|
|
|
1492
|
-
def delete_if(&
|
|
1485
|
+
def delete_if(&)
|
|
1493
1486
|
current = get_current
|
|
1494
|
-
@images.delete_if(&
|
|
1487
|
+
@images.delete_if(&)
|
|
1495
1488
|
set_current current
|
|
1496
1489
|
self
|
|
1497
1490
|
end
|
|
@@ -1529,9 +1522,9 @@ module Magick
|
|
|
1529
1522
|
end
|
|
1530
1523
|
|
|
1531
1524
|
# Override Enumerable's find_all
|
|
1532
|
-
def find_all(&
|
|
1525
|
+
def find_all(&)
|
|
1533
1526
|
current = get_current
|
|
1534
|
-
a = @images.select(&
|
|
1527
|
+
a = @images.select(&)
|
|
1535
1528
|
ilist = self.class.new
|
|
1536
1529
|
a.each { |image| ilist << image }
|
|
1537
1530
|
ilist.set_current current
|
|
@@ -1603,35 +1596,35 @@ module Magick
|
|
|
1603
1596
|
def marshal_load(ary)
|
|
1604
1597
|
@scene = ary.shift
|
|
1605
1598
|
@images = []
|
|
1606
|
-
ary.each { |a| @images << Marshal.load(a) }
|
|
1599
|
+
ary.each { |a| @images << Marshal.load(a) } # rubocop:disable Security/MarshalLoad
|
|
1607
1600
|
end
|
|
1608
1601
|
|
|
1609
1602
|
# The ImageList class supports the Magick::Image class methods by simply sending
|
|
1610
1603
|
# the method to the current image. If the method isn't explicitly supported,
|
|
1611
1604
|
# send it to the current image in the array. If there are no images, send
|
|
1612
1605
|
# it up the line. Catch a NameError and emit a useful message.
|
|
1613
|
-
def method_missing(meth_id, *args, &
|
|
1606
|
+
def method_missing(meth_id, *args, &)
|
|
1614
1607
|
if @scene
|
|
1615
1608
|
img = @images[@scene]
|
|
1616
|
-
new_img = img.public_send(meth_id, *args, &
|
|
1609
|
+
new_img = img.public_send(meth_id, *args, &)
|
|
1617
1610
|
img.equal?(new_img) ? self : new_img
|
|
1618
1611
|
else
|
|
1619
1612
|
super
|
|
1620
1613
|
end
|
|
1621
1614
|
rescue NoMethodError
|
|
1622
1615
|
Kernel.raise NoMethodError, "undefined method `#{meth_id.id2name}' for #{self.class}"
|
|
1623
|
-
rescue
|
|
1616
|
+
rescue StandardError
|
|
1624
1617
|
$ERROR_POSITION.delete_if { |s| /:in `send'$/.match(s) || /:in `method_missing'$/.match(s) }
|
|
1625
1618
|
Kernel.raise
|
|
1626
1619
|
end
|
|
1627
1620
|
|
|
1628
1621
|
# Create a new image and add it to the end
|
|
1629
|
-
def new_image(cols, rows, *fill, &
|
|
1630
|
-
self << Magick::Image.new(cols, rows, *fill, &
|
|
1622
|
+
def new_image(cols, rows, *fill, &)
|
|
1623
|
+
self << Magick::Image.new(cols, rows, *fill, &)
|
|
1631
1624
|
end
|
|
1632
1625
|
|
|
1633
|
-
def partition(&
|
|
1634
|
-
a = @images.partition(&
|
|
1626
|
+
def partition(&)
|
|
1627
|
+
a = @images.partition(&)
|
|
1635
1628
|
t = self.class.new
|
|
1636
1629
|
a[0].each { |img| t << img }
|
|
1637
1630
|
t.set_current nil
|
|
@@ -1678,18 +1671,18 @@ module Magick
|
|
|
1678
1671
|
end
|
|
1679
1672
|
|
|
1680
1673
|
# override Enumerable's reject
|
|
1681
|
-
def reject(&
|
|
1674
|
+
def reject(&)
|
|
1682
1675
|
current = get_current
|
|
1683
1676
|
ilist = self.class.new
|
|
1684
|
-
a = @images.reject(&
|
|
1677
|
+
a = @images.reject(&)
|
|
1685
1678
|
a.each { |image| ilist << image }
|
|
1686
1679
|
ilist.set_current current
|
|
1687
1680
|
ilist
|
|
1688
1681
|
end
|
|
1689
1682
|
|
|
1690
|
-
def reject!(&
|
|
1683
|
+
def reject!(&)
|
|
1691
1684
|
current = get_current
|
|
1692
|
-
a = @images.reject!(&
|
|
1685
|
+
a = @images.reject!(&)
|
|
1693
1686
|
@images = a unless a.nil?
|
|
1694
1687
|
set_current current
|
|
1695
1688
|
a.nil? ? nil : self
|
|
@@ -1732,8 +1725,8 @@ module Magick
|
|
|
1732
1725
|
self
|
|
1733
1726
|
end
|
|
1734
1727
|
|
|
1735
|
-
def reverse_each(&
|
|
1736
|
-
@images.reverse_each(&
|
|
1728
|
+
def reverse_each(&)
|
|
1729
|
+
@images.reverse_each(&)
|
|
1737
1730
|
self
|
|
1738
1731
|
end
|
|
1739
1732
|
|
data/lib/rvg/clippath.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
#++
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
7
6
|
module Magick
|
|
8
7
|
class RVG
|
|
9
8
|
class ClipPath
|
data/lib/rvg/container.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
#++
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
7
6
|
module Magick
|
|
8
7
|
class RVG
|
|
9
8
|
# Content is simply an Array with a deep_copy method.
|
data/lib/rvg/deep_equal.rb
CHANGED
data/lib/rvg/describable.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
#++
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
7
6
|
module Magick
|
|
8
7
|
class RVG
|
|
9
8
|
#--
|
|
@@ -13,7 +12,7 @@ module Magick
|
|
|
13
12
|
module Describable
|
|
14
13
|
private
|
|
15
14
|
|
|
16
|
-
def initialize(*args, &
|
|
15
|
+
def initialize(*args, &)
|
|
17
16
|
super
|
|
18
17
|
@title, @desc, @metadata = nil
|
|
19
18
|
end
|
data/lib/rvg/embellishable.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
#++
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
7
6
|
module Magick
|
|
8
7
|
class RVG
|
|
9
8
|
# Parent class of Circle, Ellipse, Text, etc.
|
|
@@ -332,8 +331,8 @@ module Magick
|
|
|
332
331
|
# transforms specified on this object will be used by objects
|
|
333
332
|
# contained within, unless overridden by an inner container or
|
|
334
333
|
# the contained object itself.
|
|
335
|
-
def rvg(cols, rows, x = 0, y = 0, &
|
|
336
|
-
rvg = Magick::RVG.new(cols, rows, &
|
|
334
|
+
def rvg(cols, rows, x = 0, y = 0, &)
|
|
335
|
+
rvg = Magick::RVG.new(cols, rows, &)
|
|
337
336
|
begin
|
|
338
337
|
x = Float(x)
|
|
339
338
|
y = Float(y)
|
|
@@ -355,8 +354,8 @@ module Magick
|
|
|
355
354
|
# the contained object itself.
|
|
356
355
|
# Define grouped elements by calling RVG::Embellishable
|
|
357
356
|
# methods within the associated block.
|
|
358
|
-
def g(&
|
|
359
|
-
group = Group.new(&
|
|
357
|
+
def g(&)
|
|
358
|
+
group = Group.new(&)
|
|
360
359
|
@content << group
|
|
361
360
|
group
|
|
362
361
|
end
|
data/lib/rvg/misc.rb
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
# Copyright (
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
5
6
|
module Magick
|
|
6
7
|
class RVG
|
|
7
8
|
# This is a standard deep_copy method that is used in most classes.
|
|
@@ -315,7 +316,7 @@ module Magick
|
|
|
315
316
|
class RVG
|
|
316
317
|
class Utility
|
|
317
318
|
class TextAttributes
|
|
318
|
-
WRITING_MODE = %w[lr-tb lr rl-tb rl tb-rl tb]
|
|
319
|
+
WRITING_MODE = %w[lr-tb lr rl-tb rl tb-rl tb].freeze
|
|
319
320
|
|
|
320
321
|
def initialize
|
|
321
322
|
@affine = []
|
|
@@ -445,39 +446,39 @@ module Magick
|
|
|
445
446
|
expanded: Magick::ExpandedStretch,
|
|
446
447
|
extra_expanded: Magick::ExtraExpandedStretch,
|
|
447
448
|
ultra_expanded: Magick::UltraExpandedStretch
|
|
448
|
-
}
|
|
449
|
+
}.freeze
|
|
449
450
|
|
|
450
451
|
FONT_STYLE = {
|
|
451
452
|
normal: Magick::NormalStyle,
|
|
452
453
|
italic: Magick::ItalicStyle,
|
|
453
454
|
oblique: Magick::ObliqueStyle
|
|
454
|
-
}
|
|
455
|
+
}.freeze
|
|
455
456
|
|
|
456
457
|
FONT_WEIGHT = {
|
|
457
458
|
normal: Magick::NormalWeight,
|
|
458
459
|
bold: Magick::BoldWeight,
|
|
459
460
|
bolder: Magick::BolderWeight,
|
|
460
461
|
lighter: Magick::LighterWeight
|
|
461
|
-
}
|
|
462
|
+
}.freeze
|
|
462
463
|
|
|
463
464
|
TEXT_ANCHOR = {
|
|
464
465
|
start: Magick::StartAnchor,
|
|
465
466
|
middle: Magick::MiddleAnchor,
|
|
466
467
|
end: Magick::EndAnchor
|
|
467
|
-
}
|
|
468
|
+
}.freeze
|
|
468
469
|
|
|
469
470
|
ANCHOR_TO_ALIGN = {
|
|
470
471
|
start: Magick::LeftAlign,
|
|
471
472
|
middle: Magick::CenterAlign,
|
|
472
473
|
end: Magick::RightAlign
|
|
473
|
-
}
|
|
474
|
+
}.freeze
|
|
474
475
|
|
|
475
476
|
TEXT_DECORATION = {
|
|
476
477
|
none: Magick::NoDecoration,
|
|
477
478
|
underline: Magick::UnderlineDecoration,
|
|
478
479
|
overline: Magick::OverlineDecoration,
|
|
479
480
|
line_through: Magick::LineThroughDecoration
|
|
480
|
-
}
|
|
481
|
+
}.freeze
|
|
481
482
|
|
|
482
483
|
TEXT_STRATEGIES = {
|
|
483
484
|
'lr-tb' => LRTextStrategy,
|
|
@@ -486,7 +487,7 @@ module Magick
|
|
|
486
487
|
'rl' => RLTextStrategy,
|
|
487
488
|
'tb-rl' => TBTextStrategy,
|
|
488
489
|
'tb' => TBTextStrategy
|
|
489
|
-
}
|
|
490
|
+
}.freeze
|
|
490
491
|
|
|
491
492
|
def self.degrees_to_radians(deg)
|
|
492
493
|
Math::PI * (deg % 360.0) / 180.0
|
|
@@ -524,8 +525,8 @@ module Magick
|
|
|
524
525
|
init_matrix
|
|
525
526
|
end
|
|
526
527
|
|
|
527
|
-
def method_missing(meth_id, *args, &
|
|
528
|
-
@gc.__send__(meth_id, *args, &
|
|
528
|
+
def method_missing(meth_id, *args, &)
|
|
529
|
+
@gc.__send__(meth_id, *args, &)
|
|
529
530
|
end
|
|
530
531
|
|
|
531
532
|
def affine(sx, rx, ry, sy, tx, ty)
|
data/lib/rvg/paint.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
#++
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
7
6
|
# Defines paint server classes.
|
|
8
7
|
# Eventually this will include gradients.
|
|
9
8
|
module Magick
|
data/lib/rvg/pathdata.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
#++
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
7
6
|
module Magick
|
|
8
7
|
class RVG
|
|
9
8
|
# The PathData class provides an object-oriented way to produce an SVG
|
data/lib/rvg/rvg.rb
CHANGED
|
@@ -1,34 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
# Copyright (C) 2009 by Timothy P. Hunter
|
|
7
|
-
#
|
|
8
|
-
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
9
|
-
# copy of this software and associated documentation files (the
|
|
10
|
-
# "Software"), to deal in the Software without restriction, including
|
|
11
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
|
12
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
13
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
|
14
|
-
# the following conditions:
|
|
15
|
-
#
|
|
16
|
-
# The above copyright notice and this permission notice shall be included
|
|
17
|
-
# in all copies or substantial portions of the Software.
|
|
18
|
-
#
|
|
19
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
20
|
-
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
21
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
22
|
-
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
23
|
-
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
24
|
-
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
25
|
-
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
# This software is OSI Certified Open Source Software.
|
|
29
|
-
# OSI Certified is a certification mark of the Open Source Initiative.
|
|
30
|
-
#
|
|
31
|
-
#++############################################################################
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
32
6
|
require 'rmagick'
|
|
33
7
|
require 'rvg/misc'
|
|
34
8
|
require 'rvg/describable'
|
data/lib/rvg/stretchable.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
#++
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
7
6
|
module Magick
|
|
8
7
|
class RVG
|
|
9
8
|
module PreserveAspectRatio
|
|
@@ -111,7 +110,7 @@ module Magick
|
|
|
111
110
|
# Add a non-scaled translation if meet or slice
|
|
112
111
|
gc.translate(tx, ty) if tx.abs > 1.0e-10 || ty.abs > 1.0e-10
|
|
113
112
|
# Scale viewbox as necessary
|
|
114
|
-
gc.scale(sx, sy) if sx
|
|
113
|
+
gc.scale(sx, sy) if (sx - 1.0).abs > Float::EPSILON || (sy - 1.0).abs > Float::EPSILON
|
|
115
114
|
# Add a scaled translation if non-0 origin
|
|
116
115
|
gc.translate(-@vbx_x, -@vbx_y) if @vbx_x.abs != 0.0 || @vbx_y.abs != 0
|
|
117
116
|
end
|
data/lib/rvg/stylable.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
#++
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
7
6
|
module Magick
|
|
8
7
|
class RVG
|
|
9
8
|
# :stopdoc:
|
|
@@ -15,7 +14,7 @@ module Magick
|
|
|
15
14
|
text_anchor text_decoration
|
|
16
15
|
glyph_orientation_vertical glyph_orientation_horizontal
|
|
17
16
|
letter_spacing word_spacing baseline_shift writing_mode
|
|
18
|
-
]
|
|
17
|
+
].freeze
|
|
19
18
|
|
|
20
19
|
Styles = Struct.new(*STYLES)
|
|
21
20
|
|
data/lib/rvg/text.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
#++
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
7
6
|
# Text-related classes
|
|
8
7
|
module Magick
|
|
9
8
|
class RVG
|
|
@@ -124,9 +123,9 @@ module Magick
|
|
|
124
123
|
# at the current text position.
|
|
125
124
|
#
|
|
126
125
|
# Tspan objects can contain Tspan objects.
|
|
127
|
-
def initialize(text = nil, x = nil, y = nil, &
|
|
126
|
+
def initialize(text = nil, x = nil, y = nil, &)
|
|
128
127
|
@x, @y = Magick::RVG.convert_to_float(x, y, :allow_nil)
|
|
129
|
-
super(text, &
|
|
128
|
+
super(text, &)
|
|
130
129
|
end
|
|
131
130
|
end # class Tspan
|
|
132
131
|
|
|
@@ -145,9 +144,9 @@ module Magick
|
|
|
145
144
|
# t.tspan("Red text").styles(:fill=>'red')
|
|
146
145
|
# t.tspan("Blue text").styles(:fill=>'blue')
|
|
147
146
|
# end
|
|
148
|
-
def initialize(x = 0, y = 0, text = nil, &
|
|
147
|
+
def initialize(x = 0, y = 0, text = nil, &)
|
|
149
148
|
@cx, @cy = Magick::RVG.convert_to_float(x, y)
|
|
150
|
-
super(text, &
|
|
149
|
+
super(text, &)
|
|
151
150
|
end
|
|
152
151
|
|
|
153
152
|
# Reference a Tspan object. <tt>x</tt> and <tt>y</tt> are just
|
|
@@ -168,8 +167,8 @@ module Magick
|
|
|
168
167
|
# Draw a text string at (<tt>x</tt>,<tt>y</tt>). The string can
|
|
169
168
|
# be omitted. Optionally, define text chunks within the associated
|
|
170
169
|
# block.
|
|
171
|
-
def text(x = 0, y = 0, text = nil, &
|
|
172
|
-
t = Text.new(x, y, text, &
|
|
170
|
+
def text(x = 0, y = 0, text = nil, &)
|
|
171
|
+
t = Text.new(x, y, text, &)
|
|
173
172
|
@content << t
|
|
174
173
|
t
|
|
175
174
|
end
|
data/lib/rvg/transformable.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
#++
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
7
6
|
module Magick
|
|
8
7
|
class RVG
|
|
9
8
|
# Transforms is an Array with a deep_copy method.
|
data/lib/rvg/units.rb
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
# Copyright (
|
|
3
|
+
# Copyright (c) 2002 - 2009 Timothy P. Hunter
|
|
4
|
+
# Copyright (c) 2009 - RMagick contributors
|
|
5
|
+
|
|
5
6
|
module Magick
|
|
6
7
|
class RVG
|
|
7
8
|
# Define RVG.dpi and RVG.dpi=. Add conversions to Integer and Float classes
|
data/rmagick.gemspec
CHANGED
|
@@ -19,15 +19,17 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
s.metadata['rubygems_mfa_required'] = 'true'
|
|
20
20
|
|
|
21
21
|
tracked_files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
|
|
22
|
-
file_exclusion_regex = /\A(doc|benchmarks|examples|spec|Steepfile)/
|
|
23
|
-
files = tracked_files.reject
|
|
22
|
+
file_exclusion_regex = /\A(\.|doc|benchmarks|examples|spec|Steepfile|before_install)/
|
|
23
|
+
files = tracked_files.reject do |file|
|
|
24
|
+
file != '.yardopts' && file[file_exclusion_regex]
|
|
25
|
+
end
|
|
24
26
|
|
|
25
27
|
s.files = files
|
|
26
28
|
s.require_paths << 'ext'
|
|
27
29
|
|
|
28
30
|
s.extensions = %w[ext/RMagick/extconf.rb]
|
|
29
|
-
s.required_ruby_version = ">= #{Magick::MIN_RUBY_VERSION}"
|
|
30
|
-
s.requirements << "ImageMagick #{Magick::
|
|
31
|
+
s.required_ruby_version = ">= #{Magick::MIN_RUBY_VERSION}" # rubocop:disable Gemspec/RequiredRubyVersion
|
|
32
|
+
s.requirements << "ImageMagick #{Magick::MIN_IM6_VERSION}+ (for ImageMagick 6) or #{Magick::MIN_IM7_VERSION}+ (for ImageMagick 7)"
|
|
31
33
|
|
|
32
34
|
s.add_dependency 'observer', '~> 0.1'
|
|
33
35
|
s.add_dependency 'pkg-config', '~> 1.4'
|
data/sig/rmagick.rbs
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:
|
|
4
|
+
version: 7.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tim Hunter
|
|
@@ -47,19 +47,6 @@ extensions:
|
|
|
47
47
|
- ext/RMagick/extconf.rb
|
|
48
48
|
extra_rdoc_files: []
|
|
49
49
|
files:
|
|
50
|
-
- ".devcontainer/Dockerfile"
|
|
51
|
-
- ".devcontainer/ImageMagick6/devcontainer.json"
|
|
52
|
-
- ".devcontainer/devcontainer.json"
|
|
53
|
-
- ".devcontainer/setup-repo.sh"
|
|
54
|
-
- ".devcontainer/setup-user.sh"
|
|
55
|
-
- ".editorconfig"
|
|
56
|
-
- ".github/ISSUE_TEMPLATE.md"
|
|
57
|
-
- ".github/ISSUE_TEMPLATE/report.yml"
|
|
58
|
-
- ".github/workflows/ci.yml"
|
|
59
|
-
- ".gitignore"
|
|
60
|
-
- ".rspec"
|
|
61
|
-
- ".rubocop.yml"
|
|
62
|
-
- ".rubocop_todo.yml"
|
|
63
50
|
- ".yardopts"
|
|
64
51
|
- CHANGELOG.md
|
|
65
52
|
- CODE_OF_CONDUCT.md
|
|
@@ -68,8 +55,6 @@ files:
|
|
|
68
55
|
- LICENSE
|
|
69
56
|
- README.md
|
|
70
57
|
- Rakefile
|
|
71
|
-
- before_install_linux.sh
|
|
72
|
-
- before_install_osx.sh
|
|
73
58
|
- ext/RMagick/extconf.rb
|
|
74
59
|
- ext/RMagick/rmagick.cpp
|
|
75
60
|
- ext/RMagick/rmagick.h
|
|
@@ -150,15 +135,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
150
135
|
requirements:
|
|
151
136
|
- - ">="
|
|
152
137
|
- !ruby/object:Gem::Version
|
|
153
|
-
version: 3.
|
|
138
|
+
version: 3.2.0
|
|
154
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
140
|
requirements:
|
|
156
141
|
- - ">="
|
|
157
142
|
- !ruby/object:Gem::Version
|
|
158
143
|
version: '0'
|
|
159
144
|
requirements:
|
|
160
|
-
- ImageMagick 6.
|
|
161
|
-
rubygems_version: 4.0.
|
|
145
|
+
- ImageMagick 6.9.0+ (for ImageMagick 6) or 7.1.0+ (for ImageMagick 7)
|
|
146
|
+
rubygems_version: 4.0.11
|
|
162
147
|
specification_version: 4
|
|
163
148
|
summary: Ruby binding to ImageMagick
|
|
164
149
|
test_files: []
|
data/.devcontainer/Dockerfile
DELETED