<commit_before># Imstor
A Golang image storage engine. Used to create and store different sizes/thumbnails of user uploaded images.

[![Build Status](https://travis-ci.org/deiwin/imstor.svg?branch=master)](https://travis-ci.org/deiwin/imstor) [![GoDoc](https://godoc.org/github.com/deiwin/imstor?status.svg)](https://godoc.org/github.com/deiwin/imstor)

## Description

**Imstor** enables you to create copies (or thumbnails) of your images and stores
them along with the original image on your filesystem. The image and its
copies are are stored in a file structure based on the (zero-prefixed, decimal)
CRC 64 checksum of the original image. The last 2 characters of the checksum
are used as the lvl 1 directory name.

**Imstor** supports any image format you can decode to go's own image.Image
and then back to your preferred format. The decoder for any given image is
chosen by the image's mimetype.

### Example folder structure
Folder name and contents, given the checksum `08446744073709551615` and
sizes named "*small*" and "*large*":
```
/configured/root/path/15/08446744073709551615/original.jpg
/configured/root/path/15/08446744073709551615/small.jpg
/configured/root/path/15/08446744073709551615/large.jpg
```

## Usage
See tests for usage examples.<commit_msg>grammar<commit_after># Imstor
A Golang image storage engine. Used to create and store different sizes/thumbnails of user uploaded images.

[![Build Status](https://travis-ci.org/deiwin/imstor.svg?branch=master)](https://travis-ci.org/deiwin/imstor) [![GoDoc](https://godoc.org/github.com/deiwin/imstor?status.svg)](https://godoc.org/github.com/deiwin/imstor)

## Description

**Imstor** enables you to create copies (or thumbnails) of your images and stores
them along with the original image on your filesystem. The image and its
copies are stored in a file structure based on the (zero-prefixed, decimal)
CRC 64 checksum of the original image. The last 2 characters of the checksum
are used as the lvl 1 directory name.

**Imstor** supports any image format you can decode to go's own image.Image
and then back to your preferred format. The decoder for any given image is
chosen by the image's mimetype.

### Example folder structure
Folder name and contents, given the checksum `08446744073709551615` and
sizes named "*small*" and "*large*":
```
/configured/root/path/15/08446744073709551615/original.jpg
/configured/root/path/15/08446744073709551615/small.jpg
/configured/root/path/15/08446744073709551615/large.jpg
```

## Usage
See tests for usage examples.
{'fraction_non_alphanumeric': 0.10173501577287067, 'fraction_numerical': 0.07097791798107256, 'mean_word_length': 5.04047619047619, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1234001', 'n_tokens_mistral': 920, 'n_tokens_neox': 787, 'n_words': 278}