# imgscan

> Node module for scanning images in directory and generating thumbnail jpg gallery

Latest version **0.0.3** (published 2019-04-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install imgscan
pnpm add imgscan
yarn add imgscan
bun add imgscan
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-04-01 |
| First published | 2019-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 119.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | nowakcasimir |
| Maintainers | nowakcasimir |
| Keywords | img, thumb, zero-dep, jpg, png, jpeg, photos, scanning, gallery, thumbnail, image, javascript, js |

## Links

- npm: https://www.npmjs.com/package/imgscan
- Repository: https://github.com/nowakcasimir/imgscan
- Homepage: https://github.com/nowakcasimir/imgscan#readme
- Issues: https://github.com/nowakcasimir/imgscan/issues
- npm.io page: https://npm.io/package/imgscan

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.3 (latest) — 2019-04-01
- 0.0.2 — 2019-04-01
- 0.0.1 — 2019-04-01

## README

# imgscan
Read images (currently JPEG and PNG) from directory and save thumbnail atlas as a JPEG file and JSON array of thumbnail boundaries.

I needed pure javascript and zero-dependency NodeJS module for reading images (JPEG and PNG) from a directory and generating new JPEG image that shows thumbnails of the images inside the directory. This is not recursing into subfolders! Module packs output image to a square size with specified thumbnail size (maintaining image aspect ratio). Resizing to thumbnail is done with bilinear interpolation.

### Example

```js
var imgscan = require('imgscan')

imgscan('/path/to/test', {
  size: 128,
  output: 'output.jpg'
})
```

### Output sample

![Output](/output.jpg?raw=true)

Module also outputs by default ```boxcache.json``` file, which is JSON data of where the images are and what files they represent. Order of the images in the atlas is not guaranteed.

```json
[
  {
    "x": 0,
    "y": 128,
    "width": 128,
    "height": 85,
    "filename": "images\\bird.jpg"
  },
  {
    "x": 0,
    "y": 213,
    "width": 128,
    "height": 82,
    "filename": "images\\Blue-Lagoon-1.jpg"
  },
  etc ...
]
```

---
_Source: https://npm.io/package/imgscan · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
