himg 0.0.8-x86_64-linux → 0.0.9-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: bcdc42fd4a8b312450b22ca52ffb2eb1e8b53198e50dcd8171b42164bbc4db0f
4
- data.tar.gz: 32876e5c9f544686a461099dd2644020cf5f7d9f260633f88a5786a23256e256
3
+ metadata.gz: 84e5a750a119fc3c6d273978acf294962bdb6e08ef871c2eab40355416f8c1ca
4
+ data.tar.gz: bb16a11c4c39b69a8d6f8ebd29fbe2d58e261751220244f8a7e0831ea91e7035
5
5
  SHA512:
6
- metadata.gz: 44d193e47c0a8af4de8d65f5e9c1866b504ce89e0c642c06c98fae80baf21e544e45846f0b01f20874eaba9196d08be2864db49921bef4df249b260e44f6b007
7
- data.tar.gz: e9c1122330a94df1a8c71d4f11480920e7c5d9d7b0ef241529df6b4d20539213b8ca1728750f20f73558c38ffb348256200f35770c186407848a81066b73cbb8
6
+ metadata.gz: 14350b0e1fca9acc21a180e7d15771af7cf08f48258738b8fe8598f5747d3d0ddee1bfc1b5b565d387be847f89a5825cd21b0f6aadb54eae2d7607a06c04afc9
7
+ data.tar.gz: bbe2fb632e9c7c0b9d31c0966f28690931d129bca69b2bc96e0ed373838128557f346ba1ff01e6d8f38c4b6d2608f33fe9836f5a7d02be2e6e0b72310d31d245
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
3
 
4
+ ## [0.0.9] - 2025-07-31
5
+
6
+ - Returned to CPU-only rendering by default
7
+ - Added `gpu` option to enable GPU rendering
8
+ - Updated to latest blitz to fix blue/green colour swap on images
9
+
4
10
  ## [0.0.8] - 2025-07-31
5
11
 
6
12
  - Return to GPU rendering by default: quality is low with CPU rendering.
data/README.md CHANGED
@@ -67,6 +67,7 @@ bundle add himg
67
67
  |base_url | Where relative paths are relative to for linked resources (stylesheets, images, fonts, etc) | string | nil |
68
68
  |disable_fetch | Disables fetching linked resources from disk and network| bool | false |
69
69
  |fetch_timeout | Timeout in seconds for fetching resources | float | 10.0 |
70
+ |gpu | Use GPU renderer instead of CPU renderer | bool | false |
70
71
 
71
72
 
72
73
  ### Passing options to a Rails view template
@@ -217,6 +218,7 @@ To play nicely with Rails a template handler is registered, which Rails' `defaul
217
218
  - http://localhost:3000/users/jamedjo.himg will also render the same png
218
219
  - http://localhost:3000/users/jamedjo will render an HTML page with opengraph meta tags
219
220
  6. To install this gem onto your local machine, run `bundle exec rake install`.
221
+ 7. To simulate a headless server environment without a GPU, use `WGPU_BACKEND=empty bundle exec rspec`
220
222
 
221
223
  ### Run cargo example directly generate image in Rust
222
224
 
data/lib/himg/3.2/himg.so CHANGED
Binary file
data/lib/himg/3.3/himg.so CHANGED
Binary file
data/lib/himg/3.4/himg.so CHANGED
Binary file
data/lib/himg/cli.rb CHANGED
@@ -12,6 +12,7 @@ module Himg
12
12
  option :verbose, type: :boolean, desc: "Enables detailed logging for debugging and profiling.", default: false
13
13
  option :disable_fetch, type: :boolean, desc: "Skip fetching file/http resources (stylesheets, images, fonts, etc)", default: false
14
14
  option :fetch_timeout, type: :numeric, desc: "Timeout in seconds for fetching resources", default: 10
15
+ option :gpu, type: :boolean, desc: "Use GPU renderer instead of CPU renderer", default: false
15
16
  option :http_headers, desc: "HTTP Headers to use when fetching remote resource"
16
17
  option :base_url, desc: "Base URL used to resolve relative URLs"
17
18
 
data/lib/himg/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Himg
4
- VERSION = "0.0.8"
4
+ VERSION = "0.0.9"
5
5
  end
data/lib/himg.rb CHANGED
@@ -17,10 +17,10 @@ end
17
17
  #
18
18
  # Converts HTML to an Image for a minimal subset of HTML and CSS
19
19
  module Himg
20
- RENDER_OPTIONS = %i[width height truncate verbose].freeze
20
+ RENDER_OPTIONS = %i[width height truncate verbose base_url disable_fetch fetch_timeout gpu].freeze
21
21
  class Error < StandardError; end
22
22
 
23
- def self.render(html, width: 720, height: 405, truncate: true, verbose: false, base_url: nil, disable_fetch: false, fetch_timeout: 10)
24
- render_to_string(html, "width" => width.to_i, "height" => height.to_i, "truncate" => truncate, "verbose" => verbose, "base_url" => BaseUrl.new(base_url).to_s, "disable_fetch" => disable_fetch, "fetch_timeout" => fetch_timeout.to_f)
23
+ def self.render(html, width: 720, height: 405, truncate: true, verbose: false, base_url: nil, disable_fetch: false, fetch_timeout: 10, gpu: false)
24
+ render_to_string(html, "width" => width.to_i, "height" => height.to_i, "truncate" => truncate, "verbose" => verbose, "base_url" => BaseUrl.new(base_url).to_s, "disable_fetch" => disable_fetch, "fetch_timeout" => fetch_timeout.to_f, "gpu" => gpu)
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: himg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - James Edwards-Jones