himg 0.0.8-aarch64-linux → 0.0.10-aarch64-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: 197d404ae666f5e4af513dcba0e99c5b2d63eaac9c99a9ddc20e6cafa6d588d1
4
- data.tar.gz: 0c1e827d654e307046d1027dc3eab17b5b5a14e213f6833dbef41f5d857daf65
3
+ metadata.gz: b4a23ed02a3c1a4845377d1e53a7c2c926e75510313fd30324f27df19885f184
4
+ data.tar.gz: 628064bcedddc3d765f2f60ee781106d9ae329a9974471886b4f467568233d70
5
5
  SHA512:
6
- metadata.gz: 03af235d07821f452a44bc382d6fe0367a1eeca5bbfb618940c6235bd05df711a12f7c81c802fd127f181783637520d66c5d3668928367919181a9d645838718
7
- data.tar.gz: 6809bda4abaea0eaa5410ec1fcc349b449ac19cc4a876601cfd2414e81f574719712b1d06f5bf286b083ec08f771bc62de56812590ffa7181bdb410b77f32958
6
+ metadata.gz: 1276e22902987c705e9f651e0d6bb1db8328e6583b3d7b2b92cb56782cfe37e428a5f20c994632845efec8f6c54f948520f873fc541b6d8ab245a52e72c7dabf
7
+ data.tar.gz: da6665b68e54ed03707a0be63d5011c45629e0ffb445984b7faa79cab6da825bbbbb8f28214d079fc7000a61c263cb843e2324d491a2fbf87aa1ca2fa26521ba
data/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  ## [Unreleased]
2
2
 
3
3
 
4
+ ## [0.0.10] - 2025-08-01
5
+
6
+ - Fixed himg require from native extension
7
+ - Catch rust panics and wrap with ruby Error
8
+ - GpuNotFound error extending Himg::Error
9
+
10
+ ## [0.0.9] - 2025-07-31
11
+
12
+ - Returned to CPU-only rendering by default
13
+ - Added `gpu` option to enable GPU rendering
14
+ - Updated to latest blitz to fix blue/green colour swap on images
15
+
4
16
  ## [0.0.8] - 2025-07-31
5
17
 
6
18
  - 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.10"
5
5
  end
data/lib/himg.rb CHANGED
@@ -8,7 +8,7 @@ require "himg/railtie" if defined?(Rails::Railtie)
8
8
  # Fall back to loading the non-versioned extension if version-specific loading fails.
9
9
  begin
10
10
  RUBY_VERSION =~ /(\d+\.\d+)/
11
- require "#{Regexp.last_match(1)}/himg/himg"
11
+ require "himg/#{Regexp.last_match(1)}/himg"
12
12
  rescue LoadError
13
13
  require "himg/himg"
14
14
  end
@@ -17,10 +17,11 @@ 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
+ class GpuNotFound < Error; end
22
23
 
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)
24
+ def self.render(html, width: 720, height: 405, truncate: true, verbose: false, base_url: nil, disable_fetch: false, fetch_timeout: 10, gpu: false)
25
+ 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
26
  end
26
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.10
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - James Edwards-Jones
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-07-31 00:00:00.000000000 Z
11
+ date: 2025-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal