ruby-vips 2.1.3 → 2.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e9c2a25819da8d93bb3cd90e9c409d475090b789bc2c1f4e30389ad665cb579
4
- data.tar.gz: 3d92ec1b0020802e05df6c632c135c8bae07478afa44a76ef2b8d3c9e5466563
3
+ metadata.gz: ff74e4e7a8b781e9fd56602fddc00adaa0355276532821a953bac3175e649534
4
+ data.tar.gz: 199957dacc1c47208a5d8a379080b76676fe3f98ba684a76fdbe5e08370d535b
5
5
  SHA512:
6
- metadata.gz: 1af7c18265746e1553e321bc2410fd37d8c1e627306bf347768893c5d0a6fa57f4663ec80c7c2d877c3a49382bfb49b45759c4af3ee181717f4eecc78f66bab4
7
- data.tar.gz: 792c89c07bda9f21e22e0938db16f9182b055b803d41dde4846f804dddc7d3f1c44469ced01f1fba82982b06c204cf22e93ed6510bdb6cac4a061193e085c6b7
6
+ metadata.gz: 9d585d3440f75759e1c07cefd6d43371db62706e0c2e9ada3512f661870f7f4c410d6dbeed138c45e16438112cc8179bae2d4477c318ac6fcf9e31487822cb63
7
+ data.tar.gz: a62254d063cd35b521e74a86377d3e83d2b2345a10186e044b2e91992bc6ff49611d6bde916cd8c530d0b2ba4da7ba4a23ca10c922be99463ab71371538cf1cf
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## Version 2.1.4 (2021-10-28)
6
+
7
+ * `write_to_buffer` tries to use the new target API, then falls back to the old
8
+ buffer system [jcupitt]
9
+ * don't generate yard docs for deprecated args [jcupitt]
10
+ * add hyperbolic trig functions [jcupitt]
11
+
5
12
  ## Version 2.1.3 (2021-8-23)
6
13
 
7
14
  * fix a gtype size error on win64 [danini-the-panini]
data/README.md CHANGED
@@ -41,7 +41,7 @@ gem "ruby-vips"
41
41
  On Windows, you'll need to set the `RUBY_DLL_PATH` environment variable to
42
42
  point to the libvips bin directory.
43
43
 
44
- # Example
44
+ ## Example
45
45
 
46
46
  ```ruby
47
47
  require "vips"
@@ -68,19 +68,24 @@ im = im.conv mask, precision: :integer
68
68
  im.write_to_file output_filename
69
69
  ```
70
70
 
71
- The `Vips` section in the API docs has a [tutorial introduction with
71
+ ## Documentation
72
+
73
+ There are [full API docs for ruby-vips on
74
+ rubydoc](https://www.rubydoc.info/gems/ruby-vips). This sometimes has issues
75
+ updating, so we have a [copy on the gh-pages for this site as
76
+ well](http://libvips.github.io/ruby-vips), which
77
+ should always work.
78
+
79
+ See the `Vips` section in the docs for a [tutorial introduction with
72
80
  examples](https://www.rubydoc.info/gems/ruby-vips/Vips).
73
81
 
74
- ruby-vips has [API
75
- documentation](http://www.rubydoc.info/gems/ruby-vips). The [libvips
76
- reference manual](https://libvips.github.io/libvips/API/current/) has a
77
- complete explanation of every method.
82
+ The [libvips reference manual](https://libvips.github.io/libvips/API/current/)
83
+ has a complete explanation of every method.
78
84
 
79
- The
80
- [`example/`](https://github.com/libvips/ruby-vips/tree/master/example)
85
+ The [`example/`](https://github.com/libvips/ruby-vips/tree/master/example)
81
86
  directory has some simple example programs.
82
87
 
83
- # Benchmarks
88
+ ## Benchmarks
84
89
 
85
90
  The benchmark at [vips-benchmarks](https://github.com/jcupitt/vips-benchmarks)
86
91
  loads a large image, crops, shrinks, sharpens and saves again, and repeats
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.3
1
+ 2.1.4
data/lib/vips/image.rb CHANGED
@@ -623,11 +623,27 @@ module Vips
623
623
  raise Vips::Error, "filename is nil" if format_string.nil?
624
624
  filename = Vips.p2str(Vips.vips_filename_get_filename(format_string))
625
625
  option_string = Vips.p2str(Vips.vips_filename_get_options(format_string))
626
- saver = Vips.vips_foreign_find_save_buffer filename
627
- raise Vips::Error if saver.nil?
628
626
 
629
- buffer = Vips::Operation.call saver, [self], opts, option_string
630
- raise Vips::Error if buffer.nil?
627
+ # try to save with the new target API first, only fall back to the old
628
+ # buffer API if there's no target save for this filetype
629
+ saver = nil
630
+ if Vips.at_least_libvips?(8, 9)
631
+ Vips.vips_error_freeze
632
+ saver = Vips.vips_foreign_find_save_target filename
633
+ Vips.vips_error_thaw
634
+ end
635
+
636
+ if !saver.nil?
637
+ target = Vips::Target.new_to_memory
638
+ Vips::Operation.call saver, [self, target], opts, option_string
639
+ buffer = target.get("blob")
640
+ else
641
+ saver = Vips.vips_foreign_find_save_buffer filename
642
+ raise Vips::Error if saver.nil?
643
+
644
+ buffer = Vips::Operation.call saver, [self], opts, option_string
645
+ raise Vips::Error if buffer.nil?
646
+ end
631
647
 
632
648
  write_gc
633
649
 
@@ -1434,6 +1450,48 @@ module Vips
1434
1450
  math :atan
1435
1451
  end
1436
1452
 
1453
+ # Return the hyperbolic sine of an image in radians.
1454
+ #
1455
+ # @return [Image] sine of each pixel
1456
+ def sinh
1457
+ math :sinh
1458
+ end
1459
+
1460
+ # Return the hyperbolic cosine of an image in radians.
1461
+ #
1462
+ # @return [Image] cosine of each pixel
1463
+ def cosh
1464
+ math :cosh
1465
+ end
1466
+
1467
+ # Return the hyperbolic tangent of an image in radians.
1468
+ #
1469
+ # @return [Image] tangent of each pixel
1470
+ def tanh
1471
+ math :tanh
1472
+ end
1473
+
1474
+ # Return the inverse hyperbolic sine of an image in radians.
1475
+ #
1476
+ # @return [Image] inverse sine of each pixel
1477
+ def asinh
1478
+ math :asinh
1479
+ end
1480
+
1481
+ # Return the inverse hyperbolic cosine of an image in radians.
1482
+ #
1483
+ # @return [Image] inverse cosine of each pixel
1484
+ def acosh
1485
+ math :acosh
1486
+ end
1487
+
1488
+ # Return the inverse hyperbolic tangent of an image in radians.
1489
+ #
1490
+ # @return [Image] inverse tangent of each pixel
1491
+ def atanh
1492
+ math :atanh
1493
+ end
1494
+
1437
1495
  # Return the natural log of an image.
1438
1496
  #
1439
1497
  # @return [Image] natural log of each pixel
@@ -1616,8 +1674,8 @@ module Vips
1616
1674
 
1617
1675
  method_args = introspect.method_args
1618
1676
  required_output = introspect.required_output
1619
- optional_input = introspect.optional_input
1620
- optional_output = introspect.optional_output
1677
+ optional_input = introspect.doc_optional_input
1678
+ optional_output = introspect.doc_optional_output
1621
1679
 
1622
1680
  print "# @!method "
1623
1681
  print "self." unless introspect.member_x
@@ -1640,17 +1698,18 @@ module Vips
1640
1698
  optional_input.each do |arg_name, details|
1641
1699
  yard_name = details[:yard_name]
1642
1700
  gtype = details[:gtype]
1701
+ rtype = gtype_to_ruby gtype
1643
1702
  blurb = details[:blurb]
1644
1703
 
1645
- puts "# @option opts [#{gtype_to_ruby(gtype)}] :#{yard_name} #{blurb}"
1704
+ puts "# @option opts [#{rtype}] :#{yard_name} #{blurb}"
1646
1705
  end
1647
1706
  optional_output.each do |arg_name, details|
1648
1707
  yard_name = details[:yard_name]
1649
1708
  gtype = details[:gtype]
1709
+ rtype = gtype_to_ruby gtype
1650
1710
  blurb = details[:blurb]
1651
1711
 
1652
- print "# @option opts [#{gtype_to_ruby(gtype)}] :#{yard_name}"
1653
- puts " Output #{blurb}"
1712
+ puts "# @option opts [#{rtype}] :#{yard_name} Output #{blurb}"
1654
1713
  end
1655
1714
 
1656
1715
  print "# @return ["