himg 0.0.6-aarch64-linux → 0.0.7-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: 460f39cc9678290ab3d11256e730910f39848c67cfab05e7e5fa944f33613ee5
4
- data.tar.gz: a8f7f83a363795bb6b3713b31578d0910786bf85d7a67d031f8488c09fbc9963
3
+ metadata.gz: 0b6691d7183234afb82958055e48962d347cf5d19cdc97f66c4011a8de625049
4
+ data.tar.gz: 9eb199b159e15fa5a84e055692a3b1dd546048a69b1876e629a7b7d997ff97e3
5
5
  SHA512:
6
- metadata.gz: b395139343d83413ef1249eb1e4bb569e1dbd9a00846c5c300a1a6b53af530c5f4cd9d1769180e5fafd8ba8ba287a96e05d9ce2e0b28165a2b60369916ca2098
7
- data.tar.gz: 5adbaf10c77966a40198149dcf3a27820a927573853ddbd3a7cedb9cde5f34df8d2d1542de29531054c2dcfdb2be5d5c8b22de3ef18c49001966e0a6893d8ee4
6
+ metadata.gz: 519f54068e8fbaf28cdb79019806532067aa9f8453fd1352c989b6d6fedb7c05a9d00867ad617fbb4a2d5b43c3935f52ec0cc01bfe6be305963ae8dfecbadde3
7
+ data.tar.gz: 4a7362ed0970b53de0bba51b1a6abf73b41651ff2b338451528274c339e237a77bd42b4c701cfb0d9942ff1f17ef6e0cf3f8282e87d27a7ffa317e5d03da09ca
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.0.7] - 2025-07-29
4
+
5
+ - Added `fetch_timeout` option to control restrict how long can be spent fetching resources.
6
+ - Move bin/himg to exe/himg so bundler can install it in on the users PATH.
7
+
3
8
  ## [0.0.6] - 2025-07-23
4
9
 
5
10
  - Added bin/himg CLI screenshot tool
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  You give it HTML and it gives back an image!
4
4
 
5
- Parses a minimal subset of HTML/CSS, fetches nested resources, renders an image on the GPU. No browser, no fuss.
5
+ Parses a minimal subset of HTML/CSS, fetches nested resources, renders an image. No browser, no fuss.
6
+
7
+ Perfect for OpenGraph images - stop losing clicks to boring links by adding a rich image preview that showcases your content.
6
8
 
7
9
  ![Mockup showing HTML being transformed into a WhatsApp preview](/readme_hero.svg)
8
10
 
@@ -11,8 +13,8 @@ Parses a minimal subset of HTML/CSS, fetches nested resources, renders an image
11
13
  ### Command Line
12
14
 
13
15
  ```bash
14
- bin/himg screenshot path/to/your.html screenshot.png
15
- bin/himg screenshot https://github.com/Jamedjo/himg himg.png --width=1024 --verbose --no-truncate
16
+ himg screenshot path/to/your.html screenshot.png
17
+ himg screenshot https://github.com/Jamedjo/himg himg.png --width=1024 --verbose --no-truncate
16
18
  ```
17
19
 
18
20
  ### Ruby
@@ -63,6 +65,7 @@ bundle add himg
63
65
  |verbose | Enables detailed logging for debugging and profiling. | bool | false |
64
66
  |base_url | Where relative paths are relative to for linked resources (stylesheets, images, fonts, etc) | string | nil |
65
67
  |disable_fetch | Disables fetching linked resources from disk and network| bool | false |
68
+ |fetch_timeout | Timeout in seconds for fetching resources | float | 10.0 |
66
69
 
67
70
 
68
71
  ### Passing options to a Rails view template
@@ -130,7 +133,7 @@ To play nicely with Rails a template handler is registered, which Rails' `defaul
130
133
 
131
134
  ## CAVEATS
132
135
 
133
- 1. This is **pre-alpha** software, don't expect it to work yet.
136
+ 1. This is **pre-alpha** software, don't expect it to work perfectly yet.
134
137
  2. Performance needs tuning. Both in the underlying blitz library and how data is passed between Rust and Ruby
135
138
  3. Network requests can be made: don't use this library with untrusted inputs. Use `disable_fetch` if you don't need to fetch any resources.
136
139
  4. file:// URLs are resolved: this could expose files on your computer. Use `disable_fetch` if you don't need to fetch any resources.
data/exe/himg ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+
5
+ require "himg"
6
+ require "himg/cli"
7
+ Himg::CLI.start(ARGV)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- himg (0.0.5)
4
+ himg (0.0.6)
5
5
  rb_sys (~> 0.9)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- himg (0.0.5)
4
+ himg (0.0.6)
5
5
  rb_sys (~> 0.9)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- himg (0.0.5)
4
+ himg (0.0.6)
5
5
  rb_sys (~> 0.9)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- himg (0.0.5)
4
+ himg (0.0.6)
5
5
  rb_sys (~> 0.9)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- himg (0.0.5)
4
+ himg (0.0.6)
5
5
  rb_sys (~> 0.9)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- himg (0.0.5)
4
+ himg (0.0.6)
5
5
  rb_sys (~> 0.9)
6
6
 
7
7
  GEM
data/lib/himg/3.2/himg.so CHANGED
Binary file
data/lib/himg/3.4/himg.so CHANGED
Binary file
data/lib/himg/cli.rb CHANGED
@@ -11,6 +11,7 @@ module Himg
11
11
  option :truncate, type: :boolean, desc: "Keeps the image height fixed instead of expanding to include the full page.", default: true
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
+ option :fetch_timeout, type: :numeric, desc: "Timeout in seconds for fetching resources", default: 10
14
15
  option :http_headers, desc: "HTTP Headers to use when fetching remote resource"
15
16
  option :base_url, desc: "Base URL used to resolve relative URLs"
16
17
 
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.6"
4
+ VERSION = "0.0.7"
5
5
  end
data/lib/himg.rb CHANGED
@@ -20,7 +20,7 @@ module Himg
20
20
  RENDER_OPTIONS = %i[width height truncate verbose].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)
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)
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)
25
25
  end
26
26
  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.6
4
+ version: 0.0.7
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-23 00:00:00.000000000 Z
11
+ date: 2025-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -136,10 +136,12 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- description: You give it HTML and it renders an Image!
139
+ description: You give it HTML and it renders an Image! No browser required. Perfect
140
+ for OpenGraph social cards so your links don't look boring when shared.
140
141
  email:
141
142
  - git@jamedjo.co.uk
142
- executables: []
143
+ executables:
144
+ - himg
143
145
  extensions: []
144
146
  extra_rdoc_files: []
145
147
  files:
@@ -153,6 +155,7 @@ files:
153
155
  - README.md
154
156
  - Rakefile
155
157
  - Steepfile
158
+ - exe/himg
156
159
  - ext/himg/examples/assets/github_profile.html
157
160
  - ext/himg/examples/assets/github_profile_offline.html
158
161
  - ext/himg/output/.gitkeep
@@ -207,5 +210,5 @@ requirements: []
207
210
  rubygems_version: 3.5.23
208
211
  signing_key:
209
212
  specification_version: 4
210
- summary: The Hyper Image Generator
213
+ summary: Renders HTML to an Image, perfect for OpenGraph social cards
211
214
  test_files: []