https://github.com/fission-codes/basquiat
Interplanetary Image Metadata Resizer
https://github.com/fission-codes/basquiat
ipfs ipld
Last synced: 29 days ago
JSON representation
Interplanetary Image Metadata Resizer
- Host: GitHub
- URL: https://github.com/fission-codes/basquiat
- Owner: fission-codes
- License: apache-2.0
- Created: 2020-04-03T19:42:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-03T10:32:14.000Z (over 4 years ago)
- Last Synced: 2025-04-03T04:56:18.230Z (about 1 month ago)
- Topics: ipfs, ipld
- Language: Rust
- Size: 57.6 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

# Basquiat - Image Resizing for ipfs
[](https://travis-ci.org/fission-suite/PROJECTNAME)
[](https://github.com/fission-suite/blob/master/LICENSE)
[](https://codeclimate.com/github/fission-suite/PROJECTNAME/maintainability)
[](https://fission.codes)
[](https://discord.gg/zAQBDEq)
[](https://talk.fission.codes)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 ipfsSee [here](https://docs.ipfs.io/guides/guides/install/).
### Setting up rust
To install rustup on Linux or MacOS
```shell script
$ curl https://sh.rustup.rs -sSf | sh
```### Setting up dependencies
The `libvips` library needs to be installed :On mac os
```shell script
brew install libvips`
```On Ubuntu
```shell scriptapt-get install libvips
```### Cloning, compiling and running
```shell script
$ git clone [email protected]:fission-suite/basquiat.git
$ cd basquiat
$ ipfs daemon > ipfsd_log.txt #The ipfs daemon must be running!
$ cargo run -q --
````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 `/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](https://github.com/ipfs/go-ipfs/issues/7190).