Skip to content

fission-codes/basquiat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basquiat - Image Resizing for ipfs

Build Status License Maintainability Built by FISSION Discord Discourse

Basquiat is a CLI tool that performs batch image resizing operations and returns an ipfs CID that links to the original, with metadata pointing to all generated versions using a general-purpose schema.

QuickStart

Installing ipfs

See here.

Setting up rust

To install rustup on Linux or MacOS

$ curl https://sh.rustup.rs -sSf | sh

Setting up dependencies

The libvips library needs to be installed :

On mac os

brew install libvips`

On Ubuntu

apt-get install libvips

Cloning, compiling and running

$ git clone git@github.com:fission-suite/basquiat.git
$ cd basquiat
$ ipfs daemon > ipfsd_log.txt #The ipfs daemon must be running!
$ cargo run -q -- <path_to_image>

cargo run builds and runs in one command. You can always find the executable at target/debug/basquiat.

Exploring the DAG

By default, a simple html page presents a list of the available versions at <root_cid>/thumbnails.html. This feature can be disabled by a flag as detailed in the command's --help message.

Proposed metadata schema

The root CID points to the original version with named links to other sizes. A given size WxH.jpg has its CID linked to three times by the root node :

_xH.jpg
Wx_.jpg
WxH.jpg

W and X are integers in pixel units.

This schema can be subsequently expanded to include transformations other than rescaling, using an expandable syntax. For a given operation c, with parameters A and B, an operation on the given size WxH.jpg will also be linked to three times:

_xH.c-A-B.jpg
Wx_.c-A-B.jpg
WxH.c-A-B.jpg

This syntax is expandable to a sequence of operations by further concatenation. For instance, the following could represent a file resized to a certain height H, then cropped from the top (operation ct) to a certain height Hp then cropped from the left (cl) to a certain width Wp :

_xH.ct-Hp.cl-Wp.jpg

This specification will also be used to configure iimir.

Known issues

  • When original file size is too small, its data gets overwritten in the output dag by a smaller version. This is due to a documented go-ipfs issue.

About

Interplanetary Image Metadata Resizer

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages