- Himg::Renderer re-used between render calls. Allows us to cache font library loading and the multi-threading runtime.
- Resolve race condition which sometimes prevented local resources from being processed.
- CLI accepts input piped from stdin, e.g
echo '<h1>Hello</h1>' | himg screenshot output.png - CLI shows usage help info when screenshot is called with incorrect arguments
- Adds missing thor dependency for CLI
- CLI automatically sets base-url for http(s) resources
- Added
--http-headersCLI option for sending custom headers when fetching the initial SOURCE HTML. - CLI prints
himg help screenshotUSAGE example by default, including version and description.
- Fixed himg require from native extension
- Catch rust panics and wrap with ruby Error
- GpuNotFound error extending Himg::Error
- Returned to CPU-only rendering by default
- Added
gpuoption to enable GPU rendering - Updated to latest blitz to fix blue/green colour swap on images
- Return to GPU rendering by default: quality is low with CPU rendering.
- Compile native Apple darwin/macos gems for intel and arm.
- Remove debug symbols saving 315MB on the binary size.
- Added
fetch_timeoutoption to control restrict how long can be spent fetching resources. - Move bin/himg to exe/himg so bundler can install it in on the users PATH.
- Updates to latest blitz
- Renders on CPU instead of GPU (experimental)
- Added bin/himg CLI screenshot tool
- Added
base_urloption for configuring relative paths - Added
disable_fetchoption for security hardening - Fixed race conditions when failing to fetch resources
- Can configure
render himg: ""with options includingwidth:,height:,truncate:andverbose:. - Can use
himg_confighelper methods at controller level and action level to set@_himg_config, which can then be passed to the renderer withrender himg: "<!DOCTYPE html>", config: himg_configas an alternative to specifying config options individually toActionController::Rendering#render. himg_confighelpers can also be used to control the configuration of template based default render, when not calling render manually within the controller. This works because the template handler can access@_himg_config.- Can use string width / height with Himg.render
- Disable detailed log timings by default. Can re-enable with verbose: true. There is still some logging from blitz-net#fetch for http requests and for blitz-html::DocumentHtmlParser#finish on unexpected tokens.
- Allow
width,heightandtruncateto be passed to the render function.
- Ensure that when render height is expanded to fit the content that we update the height we try to write in the png metadata to match.
- Rust creates a ruby string with the binary png data so we don't need to convert with .pack("C*")
- Himg::Error wraps errors from a Rust Result<_,Err>
- Added OpenGraph metadata example
- Default dimensions of 720x405 to match the ideal 16:9 ratio and image size for sharing og-image on messengers and social media.
- Adds Rails support via a ActionView template handler.
Takes views like
action.show.erb, pre-processes them with Erb and renders to a .png with 'image/png' set as the MIME type. - Adds a
ActionController::Renderersorender himg: '<div>Some HTML</div>'can be used either directly or from aformat.png/format.himgblock.
- Initial alpha