Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ozansz/image-data-uri-generator

A shell script that generates base64 encoded URI data from image files
https://github.com/ozansz/image-data-uri-generator

Last synced: 13 days ago
JSON representation

A shell script that generates base64 encoded URI data from image files

Awesome Lists containing this project

README

        

# Image Data URI Generator

A shell script that generates base64 encoded URI data from image files

## Usage

First clone the repository to your local machine:

```shell
git clone https://github.com/ozansz/image-data-uri-generator
cd image-data-uri-generator
```

And run `gen.sh`:

```shell
chmod +x gen.sh
./gen.sh foobar.png
```

The command above generates the data URI of `foobar.png` and prints to the terminal.

To save the generated data URI to a file, pass the file name as the second argument.
The command below saves the generated data URI of `foo.png` to `bar.txt`.

```shell
./gen.sh foo.png bar.txt
```

## Script Arguments

`gen.sh [outfile]`

* `file`: The image file which data URI will be generated
* `outfile`: The output file which the generated URI will be written to