# dom-image-file

> Do image file operations

Latest version **1.1.1** (published 2016-12-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install dom-image-file
pnpm add dom-image-file
yarn add dom-image-file
bun add dom-image-file
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2016-12-23 |
| First published | 2016-12-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Quentin Engles |
| Maintainers | hollowdoor |
| Keywords | image, dom, html |

## Links

- npm: https://www.npmjs.com/package/dom-image-file
- Repository: https://github.com/hollowdoor/dom_image_file
- Homepage: https://github.com/hollowdoor/dom_image_file#readme
- Issues: https://github.com/hollowdoor/dom_image_file/issues
- npm.io page: https://npm.io/package/dom-image-file

## Dependencies (4)

- [dom-css](https://npm.io/package/dom-css.md) ^2.1.0
- [dom-set](https://npm.io/package/dom-set.md) ^1.1.0
- [minimatch](https://npm.io/package/minimatch.md) ^3.0.3
- [more-events](https://npm.io/package/more-events.md) ^1.3.2

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2016-12-23
- 1.1.0 — 2016-12-23
- 1.0.0 — 2016-12-23

## README

dom-image-file
=====

Install
-------

`npm install --save dom-image-file`

Compile into your project with browserify, rollup, or some other module bundler.

Open Image
----------

```javascript
import { imageOpener } from 'dom-image-file';
//#load-image should be an input field
//When you pass an element to imageOpener
//it will hide it, and replace it with a label
//to be clicked on to save an image.
let opener = imageOpener(document.querySelector('#load-image'))

opener.on('load', images=>{
    console.log('images ',images)
    view.innerHTML = '';
    view.appendChild(images[0]);
});

```

Save An Image
-------------

```javascript
import { imageSaver } from 'dom-image-file';

let saver = imageSaver(
    document.querySelector('#save-image-as')
);

saver.on('save', ready=>{
    ready.saveAs(
        document.querySelector('#view img'),
        'mypicture.png'
    )
});

```

About
----

These methods are to be used to attach image open/save functionality to DOM elements. Specifically to input elements. Both methods only accept an input as the first argument. An input used this way should be a bare input.

Properties
----------

### innerHTML

Set the innerHTML of the elements produced by imageOpener, or imageSaver.

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