fulgur_chart 0.11.4 → 0.11.5

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: c43553971f3e572bd898b717e1666fb23b83d74c50d29e2867acd3dad1af0a1e
4
- data.tar.gz: 64bbd23be61a2f151479e69b6d05b925bdfe815c489196584023d7f2b3ad8c29
3
+ metadata.gz: 11876e1d87b035c9b58020939c8d3b103b87460350186a95fd560944a488a79f
4
+ data.tar.gz: 3ec75ee4a6321de0dc6660377c7bc4c6b41c594a86e42224ce3bee3999e3c8d6
5
5
  SHA512:
6
- metadata.gz: db7c3795da721e65429a34dcc15a62b6f861e89039deff7ff3c32ba2956f30004ca128b9fec7ff07594777e091179aa056c22693547584b3dffa1356abbe3161
7
- data.tar.gz: b4b7c1f9ab7fd011b9a30e963cc3234f6a80491abbf15807c4b360ae7c2b6069745497f27e7433d0c1ca7859582ccf1f6fbe8b1122f5f46c1256cc1fa4a96d2c
6
+ metadata.gz: 37594d4e2c422760fa3ba2b7a6f82ad109eccec7cade4d4a5fb3ad735d3341fdad129b94e24f5419affe1ebf52f6dd8f44ab03517454eda3842541ebc8f95560
7
+ data.tar.gz: 9d97be84a921b23c6eb846ba7086ac9038743b3815b4d25303390fd82f57e9420b076b7a3d5db15313522dc6829ddc7261c77378ac161a26434983a3a5fa1eec
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "fulgur_chart"
3
- version = "0.11.4"
3
+ version = "0.11.5"
4
4
  edition = "2024"
5
5
  publish = false
6
6
 
@@ -13,7 +13,7 @@ magnus = "0.7"
13
13
  # Already pulled in transitively by magnus; declaring it directly unifies to the same
14
14
  # version and makes the symbol importable.
15
15
  rb-sys = "0.9"
16
- fulgur-chart = "0.11.4"
16
+ fulgur-chart = "0.11.5"
17
17
  serde = { version = "1", features = ["derive"] }
18
18
  serde_json = "1"
19
19
  schemars = { version = "1.2", features = ["preserve_order"] }
@@ -231,6 +231,7 @@ where
231
231
  enum Rendered {
232
232
  Svg(String),
233
233
  Png(Vec<u8>),
234
+ Webp(Vec<u8>),
234
235
  }
235
236
 
236
237
  /// How a render failure is classified once back under the GVL. Mirrors the original
@@ -268,6 +269,13 @@ fn render_pure(
268
269
  .map_err(RenderFail::Render)?;
269
270
  Ok(Rendered::Png(png))
270
271
  }
272
+ "webp" => {
273
+ let fb = font.unwrap_or(fulgur_chart::font::DEFAULT_FONT);
274
+ // Invalid font on the image path → RenderError (the SVG path maps this to ParseError).
275
+ let webp = fulgur_chart::raster_direct::render_chart_to_webp(ir, scale, fb)
276
+ .map_err(RenderFail::Render)?;
277
+ Ok(Rendered::Webp(webp))
278
+ }
271
279
  other => Err(RenderFail::UnsupportedFormat(other.to_string())),
272
280
  }
273
281
  }
@@ -303,11 +311,12 @@ fn render(ruby: &Ruby, args: &[Value]) -> Result<RString, Error> {
303
311
  match result {
304
312
  Ok(Rendered::Svg(svg)) => Ok(ruby.str_new(&svg)), // UTF-8 String
305
313
  Ok(Rendered::Png(png)) => Ok(ruby.str_from_slice(&png)), // ASCII-8BIT (BINARY) String
314
+ Ok(Rendered::Webp(webp)) => Ok(ruby.str_from_slice(&webp)), // ASCII-8BIT (BINARY) String
306
315
  Err(RenderFail::Parse(m)) => Err(parse_err(ruby, m)),
307
316
  Err(RenderFail::Render(m)) => Err(render_err(ruby, m)),
308
317
  Err(RenderFail::UnsupportedFormat(other)) => Err(parse_err(
309
318
  ruby,
310
- format!("unsupported format '{other}' (supported: svg, png)"),
319
+ format!("unsupported format '{other}' (supported: svg, png, webp)"),
311
320
  )),
312
321
  }
313
322
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fulgur_chart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fulgur