#image-format #svg #png #social #content #generate #render

app social-image

Generate social images using SVG templates

11 unstable releases

0.6.0 Jan 10, 2023
0.5.3 Mar 15, 2022
0.4.0 Feb 12, 2022
0.3.6 Feb 8, 2022
0.1.0 Feb 1, 2022

#495 in Images

Download history 7/week @ 2024-02-23 6/week @ 2024-03-01 2/week @ 2024-03-08 3/week @ 2024-03-15 10/week @ 2024-03-22 65/week @ 2024-03-29

80 downloads per month

MIT/Apache

31KB
588 lines

social-image

Crates.io CI

Post SVGs and then request renderings in other formats (currently only PNG)

This is a very small helper tool that renders SVG to PNG, including resources like images and fonts. The resulting PNG can be used for social images or other live content.

Updating the SVG or any of its resources will trigger an update to the PNG.

Usage

  • GET / → help content
  • POST /images → POST SVG for render (see help content above for instructions)

Environment Variables

  • APP_ADDRESS IP address to serve on (default 127.0.0.1)
  • APP_CLI_COLORS Whether to use colors and emoji when logging. (default true)
  • APP_IDENT If and how to identify via the Server header.
  • APP_KEEP_ALIVE Keep-alive timeout seconds; disabled when 0.(default 5)
  • APP_KEY is the secret required to use API
  • APP_LOG_LEVEL one of critical, support, normal, debug, off (default critical)
  • APP_PORT Port to serve on (default 8000)
  • APP_TEMP_PATH is path to where work temporary files will be kept. (default /tmp)
  • APP_WORKERS Number of threads to use (default CPU core count)

Installation

Cargo

  • Install the rust toolchain in order to have cargo installed by following this guide.
  • Run cargo install social-image

License

At your option licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

See CONTRIBUTING.md.

Dependencies

~30–67MB
~1M SLoC