4.0.0 • Published 2 years ago

imagenation v4.0.0

Weekly downloads
9
License
UNLICENSE
Repository
-
Last release
2 years ago

Imagenation | Frontend Image Scaling and Orientation Library


TABLE OF CONTENTS

TopicDateCreated By
Introduction23-08-2019Charlie Hay
Getting Started23-08-2019Charlie Hay
Code Example23-08-2019Charlie Hay

Introduction:

Pronounced like "Imagination". Imagenation is a React Component that allows you to resize and auto-orient images in the frontend. Using EXIF data from an image file, Imagenation will ensure that images are properly oriented and scaled to the desired size. The best part is that everything is done clientside so you can leverage individual devices rather than doing all the heavy work on your server (using something like ImageMagik)

Getting Started:

1. HOW TO INSTALL:

npm i --save imagenation

2. USING THE METHOD:

// Argument 1 (REQUIRED): is the image file from the input (see below for example)
// Argument 2 (OPTIONAL): is the pixel count (height) of the output image (default 200px)
await imagenation(<IMAGE_FILE>, <RESIZE_INTEGER>)

3. DEMONSTRATION:

npm.io

Code Example:

import React, { Fragment, useState } from "react";
import ReactDOM from "react-dom";
import imagenation from "imagenation";

const App = () => {
  const [image, setImage] = useState("");

  const orientImage = async ({ target }) =>
    setImage(await imagenation(target.files[0], 500));

  return (
    <Fragment>
      <input type="file" onChange={orientImage} accept="image/*" />
      {image && <img src={image} alt="use your imagenation" />}
    </Fragment>
  );
};

ReactDOM.render(<App />, document.getElementById("root"));

Hope you enjoy Imagenation!

-Charlie Hay
4.0.0

2 years ago

3.1.4

4 years ago

3.1.3

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago