himg 0.0.7 → 0.0.9

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: 7884a5777dcf5c83efbabe6e832f6276fc83450d6807199f51a73567e1f40123
4
- data.tar.gz: 850e6467c3b7e76ae460fe4078bf3a5acd3cd3e0b0eb1bec898150671be9e7d1
3
+ metadata.gz: 83698e3a0f0875ed07ac2d68ac0b8e7aeda05fc20e53026b57bab1b3c77289fa
4
+ data.tar.gz: 55318699fee2f69974a5b4b20f23d4f6ea6c7eefab067aa33ee80f712fb9a2cc
5
5
  SHA512:
6
- metadata.gz: b0befe957c4dda3e6b5c9d0a7aff0c112564cdb080bb040562c06f80ecd37e0f5340b96e8c30fda8d8a90ddeccc53381c4d740533c6a0848fb62b2a644cc2de3
7
- data.tar.gz: 20574d4a615bed23e48027e23b79f77d5ffeef9f4e1ec75f294f38a370af772020fbacb1d4c90579b93f48f4293282d65466efe318b5fbee80bb8079630a10c5
6
+ metadata.gz: 409a23fe6d6a410e45907a4d3c69be809da4c0ed88bdeaa63c89d3cb4fe45041bafe8d52fb78d8007c7a6a9b461e069232aa1b7e5a73a893ef039bb9abb4dd6f
7
+ data.tar.gz: 3780996822f05a2de3c14e05d6a3ab778851450a8db0eb48271e5f89321eca7e79696b562280e9eb1fd57d48a5cfd84c2246f7c7ee71ca77b633e8ba21c12227
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  ## [Unreleased]
2
2
 
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
+
10
+ ## [0.0.8] - 2025-07-31
11
+
12
+ - Return to GPU rendering by default: quality is low with CPU rendering.
13
+ - Compile native Apple darwin/macos gems for intel and arm.
14
+ - Remove debug symbols saving 315MB on the binary size.
15
+
3
16
  ## [0.0.7] - 2025-07-29
4
17
 
5
18
  - Added `fetch_timeout` option to control restrict how long can be spent fetching resources.
@@ -7,6 +20,8 @@
7
20
 
8
21
  ## [0.0.6] - 2025-07-23
9
22
 
23
+ - Updates to latest blitz
24
+ - Renders on CPU instead of GPU (experimental)
10
25
  - Added bin/himg CLI screenshot tool
11
26
  - Added `base_url` option for configuring relative paths
12
27
  - Added `disable_fetch` option for security hardening
data/Cargo.lock CHANGED
@@ -38,6 +38,15 @@ version = "0.2.21"
38
38
  source = "registry+https://github.com/rust-lang/crates.io-index"
39
39
  checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
40
40
 
41
+ [[package]]
42
+ name = "android_system_properties"
43
+ version = "0.1.5"
44
+ source = "registry+https://github.com/rust-lang/crates.io-index"
45
+ checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
46
+ dependencies = [
47
+ "libc",
48
+ ]
49
+
41
50
  [[package]]
42
51
  name = "anyrender"
43
52
  version = "0.5.0"
@@ -64,10 +73,27 @@ dependencies = [
64
73
  ]
65
74
 
66
75
  [[package]]
67
- name = "anyrender_vello_cpu"
76
+ name = "anyrender_vello"
68
77
  version = "0.5.0"
69
78
  source = "registry+https://github.com/rust-lang/crates.io-index"
70
- checksum = "76e722679b9a2eea9db17748c3c05c09899bbefeb1f46ee2b3c192ad1f9631be"
79
+ checksum = "3baba14afab3466d9c2cb61afc8d27810e2209807affd945295ec6d47c2166c3"
80
+ dependencies = [
81
+ "anyrender",
82
+ "futures-intrusive",
83
+ "kurbo",
84
+ "peniko",
85
+ "pollster",
86
+ "raw-window-handle",
87
+ "rustc-hash",
88
+ "vello",
89
+ "wgpu",
90
+ ]
91
+
92
+ [[package]]
93
+ name = "anyrender_vello_cpu"
94
+ version = "0.5.1"
95
+ source = "registry+https://github.com/rust-lang/crates.io-index"
96
+ checksum = "e83dfa407bbe89c99cf990a933aeab4e1d499c38a465c3f316066a1dd3eb5614"
71
97
  dependencies = [
72
98
  "anyrender",
73
99
  "kurbo",
@@ -97,6 +123,15 @@ version = "0.7.6"
97
123
  source = "registry+https://github.com/rust-lang/crates.io-index"
98
124
  checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
99
125
 
126
+ [[package]]
127
+ name = "ash"
128
+ version = "0.38.0+1.3.281"
129
+ source = "registry+https://github.com/rust-lang/crates.io-index"
130
+ checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f"
131
+ dependencies = [
132
+ "libloading",
133
+ ]
134
+
100
135
  [[package]]
101
136
  name = "atomic-waker"
102
137
  version = "1.1.2"
@@ -156,6 +191,21 @@ dependencies = [
156
191
  "syn",
157
192
  ]
158
193
 
194
+ [[package]]
195
+ name = "bit-set"
196
+ version = "0.8.0"
197
+ source = "registry+https://github.com/rust-lang/crates.io-index"
198
+ checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
199
+ dependencies = [
200
+ "bit-vec",
201
+ ]
202
+
203
+ [[package]]
204
+ name = "bit-vec"
205
+ version = "0.8.0"
206
+ source = "registry+https://github.com/rust-lang/crates.io-index"
207
+ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
208
+
159
209
  [[package]]
160
210
  name = "bitflags"
161
211
  version = "1.3.2"
@@ -173,9 +223,9 @@ dependencies = [
173
223
 
174
224
  [[package]]
175
225
  name = "blitz-dom"
176
- version = "0.1.0-rc.1"
226
+ version = "0.1.0-rc.2"
177
227
  source = "registry+https://github.com/rust-lang/crates.io-index"
178
- checksum = "5b715adfa6d85cad5da636aac5785d40e26dcf3f4195403fe8c46be501b77d72"
228
+ checksum = "145a503f45b2284a75ca1e715dbbef4d1ccf1eeace85330e29a2ae12a01d1263"
179
229
  dependencies = [
180
230
  "accesskit",
181
231
  "app_units",
@@ -185,6 +235,7 @@ dependencies = [
185
235
  "color",
186
236
  "cursor-icon",
187
237
  "euclid",
238
+ "fastrand",
188
239
  "html-escape",
189
240
  "image",
190
241
  "keyboard-types",
@@ -210,9 +261,9 @@ dependencies = [
210
261
 
211
262
  [[package]]
212
263
  name = "blitz-html"
213
- version = "0.1.0-rc.1"
264
+ version = "0.1.0-rc.2"
214
265
  source = "registry+https://github.com/rust-lang/crates.io-index"
215
- checksum = "82a31ccea6ee542133f13ef11344c0a8fdcdc99285f30046e97b5b4478720705"
266
+ checksum = "52d34dae2ab4e90c0ccfa6470be7e455f897ae702c85d248fccdc807e375426d"
216
267
  dependencies = [
217
268
  "blitz-dom",
218
269
  "blitz-traits",
@@ -222,9 +273,9 @@ dependencies = [
222
273
 
223
274
  [[package]]
224
275
  name = "blitz-net"
225
- version = "0.1.0-rc.1"
276
+ version = "0.1.0-rc.2"
226
277
  source = "registry+https://github.com/rust-lang/crates.io-index"
227
- checksum = "a4b0b681ed5c32d0c3dafc2288cf10b9aa46e08de1a58350e5842d4d761c33ae"
278
+ checksum = "e2a5ebc8993e3985097716262d4d496c18d3324727109e3c865071776dfe38b1"
228
279
  dependencies = [
229
280
  "blitz-traits",
230
281
  "data-url",
@@ -234,9 +285,9 @@ dependencies = [
234
285
 
235
286
  [[package]]
236
287
  name = "blitz-paint"
237
- version = "0.1.0-rc.1"
288
+ version = "0.1.0-rc.2"
238
289
  source = "registry+https://github.com/rust-lang/crates.io-index"
239
- checksum = "b6b26d3c0645d2b502ec7b3984354b3c42a2af7e4bde92ed5d189ac160e4e1f5"
290
+ checksum = "9d62c7953382622298402412535db1796aaa83c71600bfc77fa7627a39aa722d"
240
291
  dependencies = [
241
292
  "anyrender",
242
293
  "anyrender_svg",
@@ -255,19 +306,26 @@ dependencies = [
255
306
 
256
307
  [[package]]
257
308
  name = "blitz-traits"
258
- version = "0.1.0-rc.1"
309
+ version = "0.1.0-rc.2"
259
310
  source = "registry+https://github.com/rust-lang/crates.io-index"
260
- checksum = "f559ae4a8b1c7dafc09df5e1249f8a27c6b9a20658a15041128d202334e8e2c2"
311
+ checksum = "4cb0235930120526087ce9d69fa2d6828e3fb078c61dde43231acec7968376bf"
261
312
  dependencies = [
262
313
  "bitflags 2.9.1",
263
314
  "bytes",
264
315
  "cursor-icon",
265
316
  "http",
266
317
  "keyboard-types",
318
+ "serde",
267
319
  "smol_str",
268
320
  "url",
269
321
  ]
270
322
 
323
+ [[package]]
324
+ name = "block"
325
+ version = "0.1.6"
326
+ source = "registry+https://github.com/rust-lang/crates.io-index"
327
+ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
328
+
271
329
  [[package]]
272
330
  name = "bumpalo"
273
331
  version = "3.19.0"
@@ -336,6 +394,12 @@ version = "1.0.1"
336
394
  source = "registry+https://github.com/rust-lang/crates.io-index"
337
395
  checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
338
396
 
397
+ [[package]]
398
+ name = "cfg_aliases"
399
+ version = "0.2.1"
400
+ source = "registry+https://github.com/rust-lang/crates.io-index"
401
+ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
402
+
339
403
  [[package]]
340
404
  name = "clang-sys"
341
405
  version = "1.8.1"
@@ -347,6 +411,16 @@ dependencies = [
347
411
  "libloading",
348
412
  ]
349
413
 
414
+ [[package]]
415
+ name = "codespan-reporting"
416
+ version = "0.11.1"
417
+ source = "registry+https://github.com/rust-lang/crates.io-index"
418
+ checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
419
+ dependencies = [
420
+ "termcolor",
421
+ "unicode-width",
422
+ ]
423
+
350
424
  [[package]]
351
425
  name = "color"
352
426
  version = "0.3.1"
@@ -378,6 +452,17 @@ version = "0.8.7"
378
452
  source = "registry+https://github.com/rust-lang/crates.io-index"
379
453
  checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
380
454
 
455
+ [[package]]
456
+ name = "core-graphics-types"
457
+ version = "0.1.3"
458
+ source = "registry+https://github.com/rust-lang/crates.io-index"
459
+ checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf"
460
+ dependencies = [
461
+ "bitflags 1.3.2",
462
+ "core-foundation",
463
+ "libc",
464
+ ]
465
+
381
466
  [[package]]
382
467
  name = "core_maths"
383
468
  version = "0.1.1"
@@ -522,6 +607,15 @@ dependencies = [
522
607
  "syn",
523
608
  ]
524
609
 
610
+ [[package]]
611
+ name = "document-features"
612
+ version = "0.2.11"
613
+ source = "registry+https://github.com/rust-lang/crates.io-index"
614
+ checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d"
615
+ dependencies = [
616
+ "litrs",
617
+ ]
618
+
525
619
  [[package]]
526
620
  name = "dtoa"
527
621
  version = "1.0.10"
@@ -692,7 +786,28 @@ version = "0.3.2"
692
786
  source = "registry+https://github.com/rust-lang/crates.io-index"
693
787
  checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
694
788
  dependencies = [
695
- "foreign-types-shared",
789
+ "foreign-types-shared 0.1.1",
790
+ ]
791
+
792
+ [[package]]
793
+ name = "foreign-types"
794
+ version = "0.5.0"
795
+ source = "registry+https://github.com/rust-lang/crates.io-index"
796
+ checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
797
+ dependencies = [
798
+ "foreign-types-macros",
799
+ "foreign-types-shared 0.3.1",
800
+ ]
801
+
802
+ [[package]]
803
+ name = "foreign-types-macros"
804
+ version = "0.2.3"
805
+ source = "registry+https://github.com/rust-lang/crates.io-index"
806
+ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
807
+ dependencies = [
808
+ "proc-macro2",
809
+ "quote",
810
+ "syn",
696
811
  ]
697
812
 
698
813
  [[package]]
@@ -701,6 +816,12 @@ version = "0.1.1"
701
816
  source = "registry+https://github.com/rust-lang/crates.io-index"
702
817
  checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
703
818
 
819
+ [[package]]
820
+ name = "foreign-types-shared"
821
+ version = "0.3.1"
822
+ source = "registry+https://github.com/rust-lang/crates.io-index"
823
+ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
824
+
704
825
  [[package]]
705
826
  name = "form_urlencoded"
706
827
  version = "1.2.1"
@@ -735,6 +856,17 @@ version = "0.3.31"
735
856
  source = "registry+https://github.com/rust-lang/crates.io-index"
736
857
  checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
737
858
 
859
+ [[package]]
860
+ name = "futures-intrusive"
861
+ version = "0.5.0"
862
+ source = "registry+https://github.com/rust-lang/crates.io-index"
863
+ checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f"
864
+ dependencies = [
865
+ "futures-core",
866
+ "lock_api",
867
+ "parking_lot",
868
+ ]
869
+
738
870
  [[package]]
739
871
  name = "futures-sink"
740
872
  version = "0.3.31"
@@ -807,18 +939,111 @@ version = "0.31.1"
807
939
  source = "registry+https://github.com/rust-lang/crates.io-index"
808
940
  checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
809
941
 
942
+ [[package]]
943
+ name = "gl_generator"
944
+ version = "0.14.0"
945
+ source = "registry+https://github.com/rust-lang/crates.io-index"
946
+ checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d"
947
+ dependencies = [
948
+ "khronos_api",
949
+ "log",
950
+ "xml-rs",
951
+ ]
952
+
810
953
  [[package]]
811
954
  name = "glob"
812
955
  version = "0.3.2"
813
956
  source = "registry+https://github.com/rust-lang/crates.io-index"
814
957
  checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
815
958
 
959
+ [[package]]
960
+ name = "glow"
961
+ version = "0.16.0"
962
+ source = "registry+https://github.com/rust-lang/crates.io-index"
963
+ checksum = "c5e5ea60d70410161c8bf5da3fdfeaa1c72ed2c15f8bbb9d19fe3a4fad085f08"
964
+ dependencies = [
965
+ "js-sys",
966
+ "slotmap",
967
+ "wasm-bindgen",
968
+ "web-sys",
969
+ ]
970
+
971
+ [[package]]
972
+ name = "glutin_wgl_sys"
973
+ version = "0.6.1"
974
+ source = "registry+https://github.com/rust-lang/crates.io-index"
975
+ checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e"
976
+ dependencies = [
977
+ "gl_generator",
978
+ ]
979
+
980
+ [[package]]
981
+ name = "gpu-alloc"
982
+ version = "0.6.0"
983
+ source = "registry+https://github.com/rust-lang/crates.io-index"
984
+ checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171"
985
+ dependencies = [
986
+ "bitflags 2.9.1",
987
+ "gpu-alloc-types",
988
+ ]
989
+
990
+ [[package]]
991
+ name = "gpu-alloc-types"
992
+ version = "0.3.0"
993
+ source = "registry+https://github.com/rust-lang/crates.io-index"
994
+ checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4"
995
+ dependencies = [
996
+ "bitflags 2.9.1",
997
+ ]
998
+
999
+ [[package]]
1000
+ name = "gpu-allocator"
1001
+ version = "0.27.0"
1002
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1003
+ checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd"
1004
+ dependencies = [
1005
+ "log",
1006
+ "presser",
1007
+ "thiserror 1.0.69",
1008
+ "windows",
1009
+ ]
1010
+
1011
+ [[package]]
1012
+ name = "gpu-descriptor"
1013
+ version = "0.3.2"
1014
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1015
+ checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca"
1016
+ dependencies = [
1017
+ "bitflags 2.9.1",
1018
+ "gpu-descriptor-types",
1019
+ "hashbrown",
1020
+ ]
1021
+
1022
+ [[package]]
1023
+ name = "gpu-descriptor-types"
1024
+ version = "0.2.0"
1025
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1026
+ checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91"
1027
+ dependencies = [
1028
+ "bitflags 2.9.1",
1029
+ ]
1030
+
816
1031
  [[package]]
817
1032
  name = "grid"
818
1033
  version = "0.17.0"
819
1034
  source = "registry+https://github.com/rust-lang/crates.io-index"
820
1035
  checksum = "71b01d27060ad58be4663b9e4ac9e2d4806918e8876af8912afbddd1a91d5eaa"
821
1036
 
1037
+ [[package]]
1038
+ name = "guillotiere"
1039
+ version = "0.6.2"
1040
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1041
+ checksum = "b62d5865c036cb1393e23c50693df631d3f5d7bcca4c04fe4cc0fd592e74a782"
1042
+ dependencies = [
1043
+ "euclid",
1044
+ "svg_fmt",
1045
+ ]
1046
+
822
1047
  [[package]]
823
1048
  name = "h2"
824
1049
  version = "0.4.11"
@@ -849,17 +1074,30 @@ dependencies = [
849
1074
  "foldhash",
850
1075
  ]
851
1076
 
1077
+ [[package]]
1078
+ name = "heck"
1079
+ version = "0.5.0"
1080
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1081
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
1082
+
852
1083
  [[package]]
853
1084
  name = "hermit-abi"
854
1085
  version = "0.5.2"
855
1086
  source = "registry+https://github.com/rust-lang/crates.io-index"
856
1087
  checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
857
1088
 
1089
+ [[package]]
1090
+ name = "hexf-parse"
1091
+ version = "0.2.1"
1092
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1093
+ checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df"
1094
+
858
1095
  [[package]]
859
1096
  name = "himg"
860
- version = "0.0.7"
1097
+ version = "0.0.9"
861
1098
  dependencies = [
862
1099
  "anyrender",
1100
+ "anyrender_vello",
863
1101
  "anyrender_vello_cpu",
864
1102
  "blitz-dom",
865
1103
  "blitz-html",
@@ -1294,6 +1532,12 @@ version = "1.0.15"
1294
1532
  source = "registry+https://github.com/rust-lang/crates.io-index"
1295
1533
  checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
1296
1534
 
1535
+ [[package]]
1536
+ name = "jni-sys"
1537
+ version = "0.3.0"
1538
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1539
+ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
1540
+
1297
1541
  [[package]]
1298
1542
  name = "js-sys"
1299
1543
  version = "0.3.77"
@@ -1315,6 +1559,23 @@ dependencies = [
1315
1559
  "unicode-segmentation",
1316
1560
  ]
1317
1561
 
1562
+ [[package]]
1563
+ name = "khronos-egl"
1564
+ version = "6.0.0"
1565
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1566
+ checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76"
1567
+ dependencies = [
1568
+ "libc",
1569
+ "libloading",
1570
+ "pkg-config",
1571
+ ]
1572
+
1573
+ [[package]]
1574
+ name = "khronos_api"
1575
+ version = "3.1.0"
1576
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1577
+ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
1578
+
1318
1579
  [[package]]
1319
1580
  name = "kurbo"
1320
1581
  version = "0.11.3"
@@ -1378,6 +1639,12 @@ version = "0.8.0"
1378
1639
  source = "registry+https://github.com/rust-lang/crates.io-index"
1379
1640
  checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956"
1380
1641
 
1642
+ [[package]]
1643
+ name = "litrs"
1644
+ version = "0.4.2"
1645
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1646
+ checksum = "f5e54036fe321fd421e10d732f155734c4e4afd610dd556d9a82833ab3ee0bed"
1647
+
1381
1648
  [[package]]
1382
1649
  name = "lock_api"
1383
1650
  version = "0.4.13"
@@ -1423,6 +1690,15 @@ dependencies = [
1423
1690
  "syn",
1424
1691
  ]
1425
1692
 
1693
+ [[package]]
1694
+ name = "malloc_buf"
1695
+ version = "0.0.6"
1696
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1697
+ checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
1698
+ dependencies = [
1699
+ "libc",
1700
+ ]
1701
+
1426
1702
  [[package]]
1427
1703
  name = "malloc_size_of_derive"
1428
1704
  version = "0.1.3"
@@ -1477,6 +1753,21 @@ dependencies = [
1477
1753
  "libc",
1478
1754
  ]
1479
1755
 
1756
+ [[package]]
1757
+ name = "metal"
1758
+ version = "0.31.0"
1759
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1760
+ checksum = "f569fb946490b5743ad69813cb19629130ce9374034abe31614a36402d18f99e"
1761
+ dependencies = [
1762
+ "bitflags 2.9.1",
1763
+ "block",
1764
+ "core-graphics-types",
1765
+ "foreign-types 0.5.0",
1766
+ "log",
1767
+ "objc",
1768
+ "paste",
1769
+ ]
1770
+
1480
1771
  [[package]]
1481
1772
  name = "mime"
1482
1773
  version = "0.3.17"
@@ -1510,6 +1801,28 @@ dependencies = [
1510
1801
  "windows-sys 0.59.0",
1511
1802
  ]
1512
1803
 
1804
+ [[package]]
1805
+ name = "naga"
1806
+ version = "24.0.0"
1807
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1808
+ checksum = "e380993072e52eef724eddfcde0ed013b0c023c3f0417336ed041aa9f076994e"
1809
+ dependencies = [
1810
+ "arrayvec",
1811
+ "bit-set",
1812
+ "bitflags 2.9.1",
1813
+ "cfg_aliases",
1814
+ "codespan-reporting",
1815
+ "hexf-parse",
1816
+ "indexmap",
1817
+ "log",
1818
+ "rustc-hash",
1819
+ "spirv",
1820
+ "strum",
1821
+ "termcolor",
1822
+ "thiserror 2.0.12",
1823
+ "unicode-xid",
1824
+ ]
1825
+
1513
1826
  [[package]]
1514
1827
  name = "native-tls"
1515
1828
  version = "0.2.14"
@@ -1527,6 +1840,15 @@ dependencies = [
1527
1840
  "tempfile",
1528
1841
  ]
1529
1842
 
1843
+ [[package]]
1844
+ name = "ndk-sys"
1845
+ version = "0.5.0+25.2.9519653"
1846
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1847
+ checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691"
1848
+ dependencies = [
1849
+ "jni-sys",
1850
+ ]
1851
+
1530
1852
  [[package]]
1531
1853
  name = "new_debug_unreachable"
1532
1854
  version = "1.0.6"
@@ -1582,6 +1904,15 @@ dependencies = [
1582
1904
  "libc",
1583
1905
  ]
1584
1906
 
1907
+ [[package]]
1908
+ name = "objc"
1909
+ version = "0.2.7"
1910
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1911
+ checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
1912
+ dependencies = [
1913
+ "malloc_buf",
1914
+ ]
1915
+
1585
1916
  [[package]]
1586
1917
  name = "objc2"
1587
1918
  version = "0.6.1"
@@ -1649,7 +1980,7 @@ checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8"
1649
1980
  dependencies = [
1650
1981
  "bitflags 2.9.1",
1651
1982
  "cfg-if",
1652
- "foreign-types",
1983
+ "foreign-types 0.3.2",
1653
1984
  "libc",
1654
1985
  "once_cell",
1655
1986
  "openssl-macros",
@@ -1695,6 +2026,15 @@ dependencies = [
1695
2026
  "vcpkg",
1696
2027
  ]
1697
2028
 
2029
+ [[package]]
2030
+ name = "ordered-float"
2031
+ version = "4.6.0"
2032
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2033
+ checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951"
2034
+ dependencies = [
2035
+ "num-traits",
2036
+ ]
2037
+
1698
2038
  [[package]]
1699
2039
  name = "parking_lot"
1700
2040
  version = "0.12.4"
@@ -1731,6 +2071,12 @@ dependencies = [
1731
2071
  "swash",
1732
2072
  ]
1733
2073
 
2074
+ [[package]]
2075
+ name = "paste"
2076
+ version = "1.0.15"
2077
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2078
+ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
2079
+
1734
2080
  [[package]]
1735
2081
  name = "peniko"
1736
2082
  version = "0.4.0"
@@ -1838,6 +2184,12 @@ dependencies = [
1838
2184
  "miniz_oxide",
1839
2185
  ]
1840
2186
 
2187
+ [[package]]
2188
+ name = "pollster"
2189
+ version = "0.4.0"
2190
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2191
+ checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"
2192
+
1841
2193
  [[package]]
1842
2194
  name = "potential_utf"
1843
2195
  version = "0.1.2"
@@ -1853,6 +2205,12 @@ version = "0.1.1"
1853
2205
  source = "registry+https://github.com/rust-lang/crates.io-index"
1854
2206
  checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
1855
2207
 
2208
+ [[package]]
2209
+ name = "presser"
2210
+ version = "0.3.1"
2211
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2212
+ checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa"
2213
+
1856
2214
  [[package]]
1857
2215
  name = "proc-macro2"
1858
2216
  version = "1.0.95"
@@ -1862,6 +2220,12 @@ dependencies = [
1862
2220
  "unicode-ident",
1863
2221
  ]
1864
2222
 
2223
+ [[package]]
2224
+ name = "profiling"
2225
+ version = "1.0.17"
2226
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2227
+ checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773"
2228
+
1865
2229
  [[package]]
1866
2230
  name = "quick-error"
1867
2231
  version = "2.0.1"
@@ -1898,6 +2262,12 @@ version = "0.6.4"
1898
2262
  source = "registry+https://github.com/rust-lang/crates.io-index"
1899
2263
  checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
1900
2264
 
2265
+ [[package]]
2266
+ name = "range-alloc"
2267
+ version = "0.1.4"
2268
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2269
+ checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde"
2270
+
1901
2271
  [[package]]
1902
2272
  name = "raw-window-handle"
1903
2273
  version = "0.6.2"
@@ -2029,6 +2399,12 @@ version = "0.8.5"
2029
2399
  source = "registry+https://github.com/rust-lang/crates.io-index"
2030
2400
  checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
2031
2401
 
2402
+ [[package]]
2403
+ name = "renderdoc-sys"
2404
+ version = "1.1.0"
2405
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2406
+ checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832"
2407
+
2032
2408
  [[package]]
2033
2409
  name = "reqwest"
2034
2410
  version = "0.12.22"
@@ -2394,6 +2770,15 @@ dependencies = [
2394
2770
  "windows-sys 0.52.0",
2395
2771
  ]
2396
2772
 
2773
+ [[package]]
2774
+ name = "spirv"
2775
+ version = "0.3.0+sdk-1.3.268.0"
2776
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2777
+ checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844"
2778
+ dependencies = [
2779
+ "bitflags 2.9.1",
2780
+ ]
2781
+
2397
2782
  [[package]]
2398
2783
  name = "stable_deref_trait"
2399
2784
  version = "1.2.0"
@@ -2440,6 +2825,28 @@ dependencies = [
2440
2825
  "quote",
2441
2826
  ]
2442
2827
 
2828
+ [[package]]
2829
+ name = "strum"
2830
+ version = "0.26.3"
2831
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2832
+ checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
2833
+ dependencies = [
2834
+ "strum_macros",
2835
+ ]
2836
+
2837
+ [[package]]
2838
+ name = "strum_macros"
2839
+ version = "0.26.4"
2840
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2841
+ checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
2842
+ dependencies = [
2843
+ "heck",
2844
+ "proc-macro2",
2845
+ "quote",
2846
+ "rustversion",
2847
+ "syn",
2848
+ ]
2849
+
2443
2850
  [[package]]
2444
2851
  name = "stylo"
2445
2852
  version = "0.4.0"
@@ -2563,9 +2970,9 @@ checksum = "500f379645e8a87fd03fe88607a5edcb0d8e4e423baa74ba52db198a06a0c261"
2563
2970
 
2564
2971
  [[package]]
2565
2972
  name = "stylo_taffy"
2566
- version = "0.1.0-rc.1"
2973
+ version = "0.1.0-rc.2"
2567
2974
  source = "registry+https://github.com/rust-lang/crates.io-index"
2568
- checksum = "94014fa36fdc4698a0b36179385d70810b6f0825b90c1df52de2aa5ee670328a"
2975
+ checksum = "dce8876a33e0f3b16916b2b4da1cdbb64b9985d5ae61033d23024d95e45569ac"
2569
2976
  dependencies = [
2570
2977
  "stylo",
2571
2978
  "taffy",
@@ -2599,6 +3006,12 @@ version = "2.6.1"
2599
3006
  source = "registry+https://github.com/rust-lang/crates.io-index"
2600
3007
  checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
2601
3008
 
3009
+ [[package]]
3010
+ name = "svg_fmt"
3011
+ version = "0.4.5"
3012
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3013
+ checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb"
3014
+
2602
3015
  [[package]]
2603
3016
  name = "svgtypes"
2604
3017
  version = "0.15.3"
@@ -2708,6 +3121,15 @@ dependencies = [
2708
3121
  "utf-8",
2709
3122
  ]
2710
3123
 
3124
+ [[package]]
3125
+ name = "termcolor"
3126
+ version = "1.4.1"
3127
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3128
+ checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
3129
+ dependencies = [
3130
+ "winapi-util",
3131
+ ]
3132
+
2711
3133
  [[package]]
2712
3134
  name = "thin-vec"
2713
3135
  version = "0.2.14"
@@ -3036,6 +3458,18 @@ version = "0.1.0"
3036
3458
  source = "registry+https://github.com/rust-lang/crates.io-index"
3037
3459
  checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94"
3038
3460
 
3461
+ [[package]]
3462
+ name = "unicode-width"
3463
+ version = "0.1.14"
3464
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3465
+ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
3466
+
3467
+ [[package]]
3468
+ name = "unicode-xid"
3469
+ version = "0.2.6"
3470
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3471
+ checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
3472
+
3039
3473
  [[package]]
3040
3474
  name = "untrusted"
3041
3475
  version = "0.9.0"
@@ -3105,6 +3539,25 @@ version = "0.2.15"
3105
3539
  source = "registry+https://github.com/rust-lang/crates.io-index"
3106
3540
  checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
3107
3541
 
3542
+ [[package]]
3543
+ name = "vello"
3544
+ version = "0.5.0"
3545
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3546
+ checksum = "df026e62e8b0d12d55ff5e91ae9114a20f82d9b856bedfdbf3abd5d1472dceed"
3547
+ dependencies = [
3548
+ "bytemuck",
3549
+ "futures-intrusive",
3550
+ "log",
3551
+ "peniko",
3552
+ "png",
3553
+ "skrifa",
3554
+ "static_assertions",
3555
+ "thiserror 2.0.12",
3556
+ "vello_encoding",
3557
+ "vello_shaders",
3558
+ "wgpu",
3559
+ ]
3560
+
3108
3561
  [[package]]
3109
3562
  name = "vello_common"
3110
3563
  version = "0.0.1"
@@ -3127,6 +3580,31 @@ dependencies = [
3127
3580
  "vello_common",
3128
3581
  ]
3129
3582
 
3583
+ [[package]]
3584
+ name = "vello_encoding"
3585
+ version = "0.5.0"
3586
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3587
+ checksum = "3c5702642f6ea77eedc12d119e1eebead0dba3cf91fe5c5d1f3efc12bf0cfaf1"
3588
+ dependencies = [
3589
+ "bytemuck",
3590
+ "guillotiere",
3591
+ "peniko",
3592
+ "skrifa",
3593
+ "smallvec",
3594
+ ]
3595
+
3596
+ [[package]]
3597
+ name = "vello_shaders"
3598
+ version = "0.5.0"
3599
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3600
+ checksum = "381790a3779021edd9f88267c1b13b49546cb0fb164f329ee2f2587869ddf459"
3601
+ dependencies = [
3602
+ "bytemuck",
3603
+ "naga",
3604
+ "thiserror 2.0.12",
3605
+ "vello_encoding",
3606
+ ]
3607
+
3130
3608
  [[package]]
3131
3609
  name = "version_check"
3132
3610
  version = "0.9.5"
@@ -3272,6 +3750,115 @@ version = "0.1.10"
3272
3750
  source = "registry+https://github.com/rust-lang/crates.io-index"
3273
3751
  checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3"
3274
3752
 
3753
+ [[package]]
3754
+ name = "wgpu"
3755
+ version = "24.0.5"
3756
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3757
+ checksum = "6b0b3436f0729f6cdf2e6e9201f3d39dc95813fad61d826c1ed07918b4539353"
3758
+ dependencies = [
3759
+ "arrayvec",
3760
+ "bitflags 2.9.1",
3761
+ "cfg_aliases",
3762
+ "document-features",
3763
+ "js-sys",
3764
+ "log",
3765
+ "naga",
3766
+ "parking_lot",
3767
+ "profiling",
3768
+ "raw-window-handle",
3769
+ "smallvec",
3770
+ "static_assertions",
3771
+ "wasm-bindgen",
3772
+ "wasm-bindgen-futures",
3773
+ "web-sys",
3774
+ "wgpu-core",
3775
+ "wgpu-hal",
3776
+ "wgpu-types",
3777
+ ]
3778
+
3779
+ [[package]]
3780
+ name = "wgpu-core"
3781
+ version = "24.0.5"
3782
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3783
+ checksum = "7f0aa306497a238d169b9dc70659105b4a096859a34894544ca81719242e1499"
3784
+ dependencies = [
3785
+ "arrayvec",
3786
+ "bit-vec",
3787
+ "bitflags 2.9.1",
3788
+ "cfg_aliases",
3789
+ "document-features",
3790
+ "indexmap",
3791
+ "log",
3792
+ "naga",
3793
+ "once_cell",
3794
+ "parking_lot",
3795
+ "profiling",
3796
+ "raw-window-handle",
3797
+ "rustc-hash",
3798
+ "smallvec",
3799
+ "thiserror 2.0.12",
3800
+ "wgpu-hal",
3801
+ "wgpu-types",
3802
+ ]
3803
+
3804
+ [[package]]
3805
+ name = "wgpu-hal"
3806
+ version = "24.0.4"
3807
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3808
+ checksum = "f112f464674ca69f3533248508ee30cb84c67cf06c25ff6800685f5e0294e259"
3809
+ dependencies = [
3810
+ "android_system_properties",
3811
+ "arrayvec",
3812
+ "ash",
3813
+ "bit-set",
3814
+ "bitflags 2.9.1",
3815
+ "block",
3816
+ "bytemuck",
3817
+ "cfg_aliases",
3818
+ "core-graphics-types",
3819
+ "glow",
3820
+ "glutin_wgl_sys",
3821
+ "gpu-alloc",
3822
+ "gpu-allocator",
3823
+ "gpu-descriptor",
3824
+ "js-sys",
3825
+ "khronos-egl",
3826
+ "libc",
3827
+ "libloading",
3828
+ "log",
3829
+ "metal",
3830
+ "naga",
3831
+ "ndk-sys",
3832
+ "objc",
3833
+ "once_cell",
3834
+ "ordered-float",
3835
+ "parking_lot",
3836
+ "profiling",
3837
+ "range-alloc",
3838
+ "raw-window-handle",
3839
+ "renderdoc-sys",
3840
+ "rustc-hash",
3841
+ "smallvec",
3842
+ "thiserror 2.0.12",
3843
+ "wasm-bindgen",
3844
+ "web-sys",
3845
+ "wgpu-types",
3846
+ "windows",
3847
+ "windows-core",
3848
+ ]
3849
+
3850
+ [[package]]
3851
+ name = "wgpu-types"
3852
+ version = "24.0.0"
3853
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3854
+ checksum = "50ac044c0e76c03a0378e7786ac505d010a873665e2d51383dcff8dd227dc69c"
3855
+ dependencies = [
3856
+ "bitflags 2.9.1",
3857
+ "js-sys",
3858
+ "log",
3859
+ "web-sys",
3860
+ ]
3861
+
3275
3862
  [[package]]
3276
3863
  name = "winapi-util"
3277
3864
  version = "0.1.9"
@@ -3557,6 +4144,12 @@ version = "0.6.1"
3557
4144
  source = "registry+https://github.com/rust-lang/crates.io-index"
3558
4145
  checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
3559
4146
 
4147
+ [[package]]
4148
+ name = "xml-rs"
4149
+ version = "0.8.27"
4150
+ source = "registry+https://github.com/rust-lang/crates.io-index"
4151
+ checksum = "6fd8403733700263c6eb89f192880191f1b83e332f7a20371ddcf421c4a337c7"
4152
+
3560
4153
  [[package]]
3561
4154
  name = "xml5ever"
3562
4155
  version = "0.35.0"
data/Cargo.toml CHANGED
@@ -5,9 +5,3 @@
5
5
  [workspace]
6
6
  members = ["./ext/himg"]
7
7
  resolver = "2"
8
-
9
- [profile.release]
10
- # By default, debug symbols are stripped from the final binary which makes it
11
- # harder to debug if something goes wrong. As we don't mind a larger binary size
12
- # we can keep these in the release build so that you can debug if needed.
13
- debug = true
data/README.md CHANGED
@@ -2,7 +2,7 @@
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. No browser, no fuss.
5
+ Parses HTML/CSS, fetches nested resources, renders an image. No browser, no fuss.
6
6
 
7
7
  Perfect for OpenGraph images - stop losing clicks to boring links by adding a rich image preview that showcases your content.
8
8
 
@@ -13,6 +13,7 @@ Perfect for OpenGraph images - stop losing clicks to boring links by adding a ri
13
13
  ### Command Line
14
14
 
15
15
  ```bash
16
+ gem install himg
16
17
  himg screenshot path/to/your.html screenshot.png
17
18
  himg screenshot https://github.com/Jamedjo/himg himg.png --width=1024 --verbose --no-truncate
18
19
  ```
@@ -66,6 +67,7 @@ bundle add himg
66
67
  |base_url | Where relative paths are relative to for linked resources (stylesheets, images, fonts, etc) | string | nil |
67
68
  |disable_fetch | Disables fetching linked resources from disk and network| bool | false |
68
69
  |fetch_timeout | Timeout in seconds for fetching resources | float | 10.0 |
70
+ |gpu | Use GPU renderer instead of CPU renderer | bool | false |
69
71
 
70
72
 
71
73
  ### Passing options to a Rails view template
@@ -121,6 +123,72 @@ respond_to do |format|
121
123
  end
122
124
  ```
123
125
 
126
+ # Supported HTML and CSS
127
+
128
+ Himg supports a large subset of the HTML and CSS you'd need to get by, but not all elements or properties are supported.
129
+
130
+ For a full list, see our [snapshot of the blitz.is status page](https://github.com/Jamedjo/himg/issues/2).
131
+
132
+ 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).
133
+
134
+ |HTML|Status|
135
+ |-|-|
136
+ |`Generic HTML5 elements`|✅ Supported|
137
+ |`<style>`|✅ Supported|
138
+ |`<link rel="stylesheet">`|✅ Supported|
139
+ |`<link rel="icon">`|❌ Not supported|
140
+ |`<img src="">`|✅ Supported|
141
+ |`<img srcset="">`|❌ Not supported|
142
+ |`<picture>`|❌ Not supported|
143
+ |`<svg>`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
144
+ |`<h1>-<h6>`|✅ Supported|
145
+ |`<ul>/<ol>`|✅ Supported|
146
+ |`<i>/<em>`|✅ Supported|
147
+ |`<b>/<strong>`|✅ Supported|
148
+ |`<u>`|✅ Supported|
149
+ |`<center>`|✅ Supported|
150
+ |`<pre>/<blockquote>`|✅ Supported|
151
+ |`<a>`|✅ Supported|
152
+ |`<br>`|✅ Supported|
153
+ |`<hr>`|❌ Not supported|
154
+ |`<details>/<summary>`|❌ Not supported|
155
+ |`<table>`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
156
+ |`Form Controls`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
157
+
158
+ |CSS|Status|
159
+ |-|-|
160
+ |`display:inline, display:block, display:inline-block`|✅ Supported|
161
+ |`display:none`|✅ Supported|
162
+ |`display:flex`|✅ Supported|
163
+ |`display:grid`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
164
+ |`display:table`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
165
+ |`display:contents`|❌ Not supported|
166
+ |`position:relative, position:absolute`|✅ Supported|
167
+ |`position:static, position:fixed, position:sticky`|❌ Not supported|
168
+ |`overflow`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
169
+ |`z-index`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
170
+ |`box-sizing`|✅ Supported|
171
+ |`float`|❌ Not supported|
172
+ |`content (::before / ::after)`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
173
+ |`opacity, visibility`|✅ Supported|
174
+ |`width, height`|✅ Supported|
175
+ |`min-width, max-width, min-height, max-height`|✅ Supported|
176
+ |`padding, margin, gap`|✅ Supported|
177
+ |`border`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
178
+ |`@font-face, font-size, font-family`|✅ Supported|
179
+ |`font-weight, font-style, font-stretch`|✅ Supported|
180
+ |`font-display, font-variant, font-feature-settings`|❌ Not supported|
181
+ |`color, text-align, line-height, text-decoration`|✅ Supported|
182
+ |`letter-spacing, overlap-wrap, word-wrap, word-break`|✅ Supported|
183
+ |`vertical-align, text-transform, text-overflow`|❌ Not supported|
184
+ |`border`|⚠️ [Partial support](https://github.com/Jamedjo/himg/issues/2)|
185
+ |`background-color, background-image`|✅ Supported|
186
+ |`background-size, background-position`|✅ Supported|
187
+ |`background-repeat, background-clip, background-origin`|✅ Supported|
188
+ |`background-attachment`|❌ Not supported|
189
+ |`box-shadow`|✅ Supported|
190
+ |`filter`|❌ Not supported|
191
+
124
192
  # How it works
125
193
 
126
194
  No browser, just basics!
@@ -150,6 +218,7 @@ To play nicely with Rails a template handler is registered, which Rails' `defaul
150
218
  - http://localhost:3000/users/jamedjo.himg will also render the same png
151
219
  - http://localhost:3000/users/jamedjo will render an HTML page with opengraph meta tags
152
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`
153
222
 
154
223
  ### Run cargo example directly generate image in Rust
155
224
 
data/ext/himg/Cargo.toml CHANGED
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  name = "himg"
3
3
  description = "ruby bindings to expose a blitz html->png pipeline"
4
- version = "0.0.7"
4
+ version = "0.0.9"
5
5
  edition = "2024"
6
6
  authors = ["James Edwards-Jones <git@jamedjo.co.uk>"]
7
7
  license = "MIT"
@@ -14,22 +14,18 @@ crate-type = ["cdylib", "rlib"]
14
14
  [dependencies]
15
15
  magnus = { version = "0.7.1" }
16
16
  rb-sys = { version = "0.9", features = ["stable-api-compiled-fallback"] }
17
- blitz-traits = { version = "0.1.0-rc.1" }
18
- blitz-dom = { version = "0.1.0-rc.1" }
19
- blitz-net = { version = "0.1.0-rc.1" }
20
- blitz-paint = { version = "0.1.0-rc.1" }
17
+ blitz-traits = { version = "0.1.0-rc.2" }
18
+ blitz-dom = { version = "0.1.0-rc.2" }
19
+ blitz-net = { version = "0.1.0-rc.2" }
20
+ blitz-paint = { version = "0.1.0-rc.2" }
21
21
  anyrender = { version = "0.5.0" }
22
- anyrender_vello_cpu = { version = "0.5.0" }
23
- blitz-html = { version = "0.1.0-rc.1" }
22
+ anyrender_vello = { version = "0.5.0" }
23
+ anyrender_vello_cpu = { version = "0.5.1" }
24
+ blitz-html = { version = "0.1.0-rc.2" }
24
25
  tokio = { version = "1.46", features = ["rt-multi-thread", "macros"] }
25
26
  png = "0.17"
26
27
  openssl = { version = "0.10", features = ["vendored"] }
27
28
 
28
- #euclid = { workspace = true }
29
- #image = { workspace = true }
30
- #env_logger = "0.11"
31
- #tracing-subscriber = "0.3"
32
-
33
29
  [build-dependencies]
34
30
  rb-sys-env = "0.2.2"
35
31
 
@@ -35,6 +35,7 @@ async fn main() {
35
35
  color_scheme: ColorScheme::Light,
36
36
  disable_fetch: false,
37
37
  fetch_timeout: 10.0,
38
+ gpu: false,
38
39
  base_url: Some(base_url),
39
40
  };
40
41
 
@@ -1,5 +1,6 @@
1
1
  use blitz_html::HtmlDocument;
2
2
  use blitz_dom::DocumentConfig;
3
+ use anyrender_vello::VelloImageRenderer;
3
4
  use anyrender_vello_cpu::VelloCpuImageRenderer;
4
5
  use anyrender::render_to_buffer;
5
6
  use blitz_paint::paint_scene;
@@ -79,17 +80,31 @@ pub async fn html_to_image(
79
80
  }
80
81
 
81
82
  // Render document to RGBA buffer
82
- let buffer = render_to_buffer::<VelloCpuImageRenderer, _>(
83
- |scene| paint_scene(
84
- scene,
85
- document.as_ref(),
86
- render_size.hidpi_scale,
83
+ let buffer = if options.gpu {
84
+ render_to_buffer::<VelloImageRenderer, _>(
85
+ |scene| paint_scene(
86
+ scene,
87
+ document.as_ref(),
88
+ render_size.hidpi_scale,
89
+ render_size.scaled_width(),
90
+ render_size.scaled_height(),
91
+ ),
87
92
  render_size.scaled_width(),
88
93
  render_size.scaled_height(),
89
- ),
90
- render_size.scaled_width(),
91
- render_size.scaled_height(),
92
- );
94
+ )
95
+ } else {
96
+ render_to_buffer::<VelloCpuImageRenderer, _>(
97
+ |scene| paint_scene(
98
+ scene,
99
+ document.as_ref(),
100
+ render_size.hidpi_scale,
101
+ render_size.scaled_width(),
102
+ render_size.scaled_height(),
103
+ ),
104
+ render_size.scaled_width(),
105
+ render_size.scaled_height(),
106
+ )
107
+ };
93
108
 
94
109
  logger.log("Rendered to buffer");
95
110
 
data/ext/himg/src/lib.rs CHANGED
@@ -34,6 +34,7 @@ impl Options {
34
34
  base_url: hash.lookup("base_url")?,
35
35
  disable_fetch: hash.lookup2("disable_fetch", defaults.disable_fetch)?,
36
36
  fetch_timeout: hash.lookup2("fetch_timeout", defaults.fetch_timeout)?,
37
+ gpu: hash.lookup2("gpu", defaults.gpu)?,
37
38
  color_scheme: defaults.color_scheme,
38
39
  };
39
40
 
@@ -8,6 +8,7 @@ pub struct Options {
8
8
  pub color_scheme: ColorScheme,
9
9
  pub disable_fetch: bool,
10
10
  pub fetch_timeout: f64,
11
+ pub gpu: bool,
11
12
  pub base_url: Option<String>,
12
13
  pub truncate: bool,
13
14
  pub verbose: bool,
@@ -26,6 +27,7 @@ impl Options {
26
27
  base_url: None,
27
28
  disable_fetch: false,
28
29
  fetch_timeout: 10.0,
30
+ gpu: false,
29
31
  color_scheme: ColorScheme::Light,
30
32
  }
31
33
  }
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.7"
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.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Edwards-Jones