svg2img 0.1.1-x86_64-linux → 0.2.0-x86_64-linux

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: 5be90cfab6cbc59aee3a8ec66e603d09ecc2b30425c1a9e19a7a8910e83e7705
4
- data.tar.gz: 8d97de036be9bc57660c11d00408d4aedfd42f957db80fbc8ea273af68dee47b
3
+ metadata.gz: cb45feae53bf81f067ebf6594892164044ee6c892406d5bef31ff651294ae2ba
4
+ data.tar.gz: f2336c48fc8487b51e322194ebd7ec1cd1064b9e4c07521f9c437547812ebd3e
5
5
  SHA512:
6
- metadata.gz: 0d77229d237150d65a36b0e952c3f0c467f630b5212af14cc12d1d3cc0fa2715c166412558902ea5e437567e3333beda4550c63efd337482f928e0c99da23057
7
- data.tar.gz: 641d7030b540cfbbcda51305a56a76b1da4a08a127a4dfdab10319185fb58016476608da6c4d407576aa3af61d71ade068fa892804a1c11b18403c2c5aeb7d3f
6
+ metadata.gz: c90f8f7858bb5f8d46325c6f1c516449c19769f00467a1a65387e2de9a8ead140fcec6f4e7ac2105bc9b2ea01aade8efee38120ce67d23fca1f97061da39679f
7
+ data.tar.gz: c3f89496e7cc5ae490630468e549ade5354ce37eed37b4cb8529497a7b471191cbd44594071e0774841ee337b743197d2ee4c8fce166db4afeb1a6309be786cb
data/README.md CHANGED
@@ -55,7 +55,7 @@ png_path = Svg2Img.process_svg(circle_svg, output_format: :png)
55
55
 
56
56
  # Rails example
57
57
  data = Rails.cache.fetch([some, deps]) do
58
- png_path = Svg2Img.process_svg(circle_svg, output_format: :png)
58
+ png_path = Svg2Img.process_svg(circle_svg, output_format: :png, size: proc {|_svg_width, _svg_height| [256, 256]})
59
59
  png_data = File.binread(png_path)
60
60
  File.delete(png_path)
61
61
  png_data
@@ -63,6 +63,11 @@ end
63
63
  send_data(png_data, type: 'image/png', disposition: 'inline')
64
64
  ```
65
65
 
66
+ ### Options
67
+
68
+ - `output_format` - output format, one of `:png`, `:jpg`, `:webp`, `:gif`
69
+ - `size` - size of the output image as a proc that receives the width and height of the SVG and returns an array with the width and height of the output image. If the provides size has a different aspect ratio than the SVG, the image will be resized to fit in the center of the provided size. If not provided, the output image will have the same size as the SVG.
70
+
66
71
  ## Development
67
72
 
68
73
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Svg2Img
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svg2img
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Orvar Segerström