Datasette plugin that renders binary blob images using data-uris
Project description
datasette-render-images
A Datasette plugin that renders binary blob images with data-uris, using the render_cell() plugin hook.
Installation
Install this plugin in the same environment as Datasette.
$ pip install datasette-render-images
Usage
If a database row contains binary image data (PNG, GIF or JPEG), this plugin will detect that it is an image (using the imghdr module and render that cell using an <img src="data:image/png;base64,...">
element.
Here's a demo of the plugin in action.
Configuration
By default the plugin will only render images that are smaller than 100KB. You can adjust this limit using the size_limit
plugin configuration option - for example, to increase the limit to 1MB (1000000 bytes) use the following in metadata.json
:
{
"plugins": {
"datasette-render-images": {
"size_limit": 1000000
}
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for datasette_render_images-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c1bb0dc2d91e65f7fa24e458cb1b0abd34c2786d4883cac05d1e4864f586d0c |
|
MD5 | f98bfb9bfcba496ca06f404ebe7e7ee3 |
|
BLAKE2b-256 | 3ceb54cd4244e1ad1bc229bc4efedf788891ed0afa6b1f35b3d2f04064cb52dc |