himg 0.0.6-aarch64-linux → 0.0.8-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 +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +74 -4
- data/exe/himg +7 -0
- data/gemfiles/plain_ruby.gemfile.lock +1 -1
- data/gemfiles/rails_6.gemfile.lock +1 -1
- data/gemfiles/rails_7_0.gemfile.lock +1 -1
- data/gemfiles/rails_7_1.gemfile.lock +1 -1
- data/gemfiles/rails_7_2.gemfile.lock +1 -1
- data/gemfiles/rails_8.gemfile.lock +1 -1
- data/lib/himg/3.2/himg.so +0 -0
- data/lib/himg/3.3/himg.so +0 -0
- data/lib/himg/3.4/himg.so +0 -0
- data/lib/himg/cli.rb +1 -0
- data/lib/himg/version.rb +1 -1
- data/lib/himg.rb +2 -2
- metadata +9 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 197d404ae666f5e4af513dcba0e99c5b2d63eaac9c99a9ddc20e6cafa6d588d1
|
4
|
+
data.tar.gz: 0c1e827d654e307046d1027dc3eab17b5b5a14e213f6833dbef41f5d857daf65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03af235d07821f452a44bc382d6fe0367a1eeca5bbfb618940c6235bd05df711a12f7c81c802fd127f181783637520d66c5d3668928367919181a9d645838718
|
7
|
+
data.tar.gz: 6809bda4abaea0eaa5410ec1fcc349b449ac19cc4a876601cfd2414e81f574719712b1d06f5bf286b083ec08f771bc62de56812590ffa7181bdb410b77f32958
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,21 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
|
4
|
+
## [0.0.8] - 2025-07-31
|
5
|
+
|
6
|
+
- Return to GPU rendering by default: quality is low with CPU rendering.
|
7
|
+
- Compile native Apple darwin/macos gems for intel and arm.
|
8
|
+
- Remove debug symbols saving 315MB on the binary size.
|
9
|
+
|
10
|
+
## [0.0.7] - 2025-07-29
|
11
|
+
|
12
|
+
- Added `fetch_timeout` option to control restrict how long can be spent fetching resources.
|
13
|
+
- Move bin/himg to exe/himg so bundler can install it in on the users PATH.
|
14
|
+
|
3
15
|
## [0.0.6] - 2025-07-23
|
4
16
|
|
17
|
+
- Updates to latest blitz
|
18
|
+
- Renders on CPU instead of GPU (experimental)
|
5
19
|
- Added bin/himg CLI screenshot tool
|
6
20
|
- Added `base_url` option for configuring relative paths
|
7
21
|
- Added `disable_fetch` option for security hardening
|
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
|
5
|
+
Parses 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
|

|
8
10
|
|
@@ -11,8 +13,9 @@ Parses a minimal subset of HTML/CSS, fetches nested resources, renders an image
|
|
11
13
|
### Command Line
|
12
14
|
|
13
15
|
```bash
|
14
|
-
|
15
|
-
|
16
|
+
gem install himg
|
17
|
+
himg screenshot path/to/your.html screenshot.png
|
18
|
+
himg screenshot https://github.com/Jamedjo/himg himg.png --width=1024 --verbose --no-truncate
|
16
19
|
```
|
17
20
|
|
18
21
|
### Ruby
|
@@ -63,6 +66,7 @@ bundle add himg
|
|
63
66
|
|verbose | Enables detailed logging for debugging and profiling. | bool | false |
|
64
67
|
|base_url | Where relative paths are relative to for linked resources (stylesheets, images, fonts, etc) | string | nil |
|
65
68
|
|disable_fetch | Disables fetching linked resources from disk and network| bool | false |
|
69
|
+
|fetch_timeout | Timeout in seconds for fetching resources | float | 10.0 |
|
66
70
|
|
67
71
|
|
68
72
|
### Passing options to a Rails view template
|
@@ -118,6 +122,72 @@ respond_to do |format|
|
|
118
122
|
end
|
119
123
|
```
|
120
124
|
|
125
|
+
# Supported HTML and CSS
|
126
|
+
|
127
|
+
Himg supports a large subset of the HTML and CSS you'd need to get by, but not all elements or properties are supported.
|
128
|
+
|
129
|
+
For a full list, see our [snapshot of the blitz.is status page](https://github.com/Jamedjo/himg/issues/2).
|
130
|
+
|
131
|
+
If something you'd like supported is missing and is available [upstream on blitz](https://blitz.is/status), please [open an issue](https://github.com/Jamedjo/himg/issues/new).
|
132
|
+
|
133
|
+
|HTML|Status|
|
134
|
+
|-|-|
|
135
|
+
|`Generic HTML5 elements`|✅ Supported|
|
136
|
+
|`<style>`|✅ Supported|
|
137
|
+
|`<link rel="stylesheet">`|✅ Supported|
|
138
|
+
|`<link rel="icon">`|❌ Not supported|
|
139
|
+
|`<img src="">`|✅ Supported|
|
140
|
+
|`<img srcset="">`|❌ Not supported|
|
141
|
+
|`<picture>`|❌ Not supported|
|
142
|
+
|`<svg>`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
|
143
|
+
|`<h1>-<h6>`|✅ Supported|
|
144
|
+
|`<ul>/<ol>`|✅ Supported|
|
145
|
+
|`<i>/<em>`|✅ Supported|
|
146
|
+
|`<b>/<strong>`|✅ Supported|
|
147
|
+
|`<u>`|✅ Supported|
|
148
|
+
|`<center>`|✅ Supported|
|
149
|
+
|`<pre>/<blockquote>`|✅ Supported|
|
150
|
+
|`<a>`|✅ Supported|
|
151
|
+
|`<br>`|✅ Supported|
|
152
|
+
|`<hr>`|❌ Not supported|
|
153
|
+
|`<details>/<summary>`|❌ Not supported|
|
154
|
+
|`<table>`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
|
155
|
+
|`Form Controls`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
|
156
|
+
|
157
|
+
|CSS|Status|
|
158
|
+
|-|-|
|
159
|
+
|`display:inline, display:block, display:inline-block`|✅ Supported|
|
160
|
+
|`display:none`|✅ Supported|
|
161
|
+
|`display:flex`|✅ Supported|
|
162
|
+
|`display:grid`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
|
163
|
+
|`display:table`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
|
164
|
+
|`display:contents`|❌ Not supported|
|
165
|
+
|`position:relative, position:absolute`|✅ Supported|
|
166
|
+
|`position:static, position:fixed, position:sticky`|❌ Not supported|
|
167
|
+
|`overflow`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
|
168
|
+
|`z-index`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
|
169
|
+
|`box-sizing`|✅ Supported|
|
170
|
+
|`float`|❌ Not supported|
|
171
|
+
|`content (::before / ::after)`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
|
172
|
+
|`opacity, visibility`|✅ Supported|
|
173
|
+
|`width, height`|✅ Supported|
|
174
|
+
|`min-width, max-width, min-height, max-height`|✅ Supported|
|
175
|
+
|`padding, margin, gap`|✅ Supported|
|
176
|
+
|`border`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
|
177
|
+
|`@font-face, font-size, font-family`|✅ Supported|
|
178
|
+
|`font-weight, font-style, font-stretch`|✅ Supported|
|
179
|
+
|`font-display, font-variant, font-feature-settings`|❌ Not supported|
|
180
|
+
|`color, text-align, line-height, text-decoration`|✅ Supported|
|
181
|
+
|`letter-spacing, overlap-wrap, word-wrap, word-break`|✅ Supported|
|
182
|
+
|`vertical-align, text-transform, text-overflow`|❌ Not supported|
|
183
|
+
|`border`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
|
184
|
+
|`background-color, background-image`|✅ Supported|
|
185
|
+
|`background-size, background-position`|✅ Supported|
|
186
|
+
|`background-repeat, background-clip, background-origin`|✅ Supported|
|
187
|
+
|`background-attachment`|❌ Not supported|
|
188
|
+
|`box-shadow`|✅ Supported|
|
189
|
+
|`filter`|❌ Not supported|
|
190
|
+
|
121
191
|
# How it works
|
122
192
|
|
123
193
|
No browser, just basics!
|
@@ -130,7 +200,7 @@ To play nicely with Rails a template handler is registered, which Rails' `defaul
|
|
130
200
|
|
131
201
|
## CAVEATS
|
132
202
|
|
133
|
-
1. This is **pre-alpha** software, don't expect it to work yet.
|
203
|
+
1. This is **pre-alpha** software, don't expect it to work perfectly yet.
|
134
204
|
2. Performance needs tuning. Both in the underlying blitz library and how data is passed between Rust and Ruby
|
135
205
|
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
206
|
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
data/lib/himg/3.2/himg.so
CHANGED
Binary file
|
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
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.
|
4
|
+
version: 0.0.8
|
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-
|
11
|
+
date: 2025-07-31 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
|
@@ -170,6 +173,7 @@ files:
|
|
170
173
|
- gemfiles/rails_8.gemfile.lock
|
171
174
|
- lib/himg.rb
|
172
175
|
- lib/himg/3.2/himg.so
|
176
|
+
- lib/himg/3.3/himg.so
|
173
177
|
- lib/himg/3.4/himg.so
|
174
178
|
- lib/himg/base_url.rb
|
175
179
|
- lib/himg/cli.rb
|
@@ -207,5 +211,5 @@ requirements: []
|
|
207
211
|
rubygems_version: 3.5.23
|
208
212
|
signing_key:
|
209
213
|
specification_version: 4
|
210
|
-
summary:
|
214
|
+
summary: Renders HTML to an Image, perfect for OpenGraph social cards
|
211
215
|
test_files: []
|