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 +4 -4
- data/README.md +6 -1
- data/lib/svg2img/3.2/svg2img.so +0 -0
- data/lib/svg2img/3.3/svg2img.so +0 -0
- data/lib/svg2img/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb45feae53bf81f067ebf6594892164044ee6c892406d5bef31ff651294ae2ba
|
4
|
+
data.tar.gz: f2336c48fc8487b51e322194ebd7ec1cd1064b9e4c07521f9c437547812ebd3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/lib/svg2img/3.2/svg2img.so
CHANGED
Binary file
|
data/lib/svg2img/3.3/svg2img.so
CHANGED
Binary file
|
data/lib/svg2img/version.rb
CHANGED