From 405640e569d152570602c269bbcb97a1abedacb4 Mon Sep 17 00:00:00 2001
From: Kevin Gravier
Date: Wed, 17 Jan 2018 23:26:01 -0500
Subject: [PATCH] More Typescript re-write work
Renamed many files
Refactored tests
---
CHANGELOG.md | 3 +
README.md | 8 +-
docs/classes/baddestinationerror.html | 2 +-
docs/classes/imagemagickmissingerror.html | 2 +-
docs/classes/missingextensionerror.html | 2 +-
docs/classes/missingoptionserror.html | 2 +-
docs/classes/unsupportederror.html | 2 +-
docs/globals.html | 26 +-
docs/index.html | 26 +-
docs/interfaces/ibaseoptions.html | 14 +-
docs/interfaces/iconvertoptions.html | 14 +-
docs/interfaces/icropoptions.html | 28 +-
docs/interfaces/idensity.html | 4 +-
.../interfaces/iimagemagickcommandresult.html | 4 +-
docs/interfaces/iinforesult.html | 20 +-
docs/interfaces/irescropoptions.html | 36 +-
docs/interfaces/iresizeoptions.html | 22 +-
docs/interfaces/irotateoptions.html | 16 +-
docs/interfaces/ithumbnailoptions.html | 26 +-
lib/EasyImage.js | 28 --
lib/{Commands => commands}/convert.js | 14 +-
lib/{Commands => commands}/crop.js | 20 +-
lib/{Commands => commands}/info.js | 6 +-
lib/{Commands => commands}/rescrop.js | 18 +-
lib/{Commands => commands}/resize.js | 14 +-
lib/{Commands => commands}/rotate.js | 14 +-
lib/{Commands => commands}/thumbnail.js | 16 +-
lib/easyimage.js | 28 ++
lib/{Errors => errors}/BadDestinationError.js | 0
.../ImageMagickMissingError.js | 0
.../MissingExtensionError.js | 0
lib/{Errors => errors}/MissingOptionsError.js | 0
lib/{Errors => errors}/UnsupportedError.js | 0
lib/{ImageMagick.js => execute.js} | 4 +-
lib/{Options.js => options.js} | 0
lib/{Utilities.js => utilities.js} | 6 +-
package-lock.json | 327 +++++++++++++++++
package.json | 19 +-
src/EasyImage.ts | 27 --
src/{Commands => commands}/convert.ts | 6 +-
src/{Commands => commands}/crop.ts | 12 +-
src/{Commands => commands}/info.ts | 4 +-
src/{Commands => commands}/rescrop.ts | 11 +-
src/{Commands => commands}/resize.ts | 6 +-
src/{Commands => commands}/rotate.ts | 6 +-
src/{Commands => commands}/thumbnail.ts | 6 +-
src/easyimage.ts | 27 ++
src/{Errors => errors}/BadDestinationError.ts | 0
.../ImageMagickMissingError.ts | 0
.../MissingExtensionError.ts | 0
src/{Errors => errors}/MissingOptionsError.ts | 0
src/{Errors => errors}/UnsupportedError.ts | 0
src/{ImageMagick.ts => execute.ts} | 4 +-
src/{Options.ts => options.ts} | 0
src/{Utilities.ts => utilities.ts} | 8 +-
test/files/tall.png | Bin 0 -> 3556 bytes
test/{ => files}/test.pdf | Bin
test/files/wide.jpg | Bin 0 -> 5577 bytes
test/files/wide.png | Bin 0 -> 3565 bytes
test/specs/convert.spec.ts | 125 +++++++
test/specs/crop.spec.ts | 78 +++++
test/specs/easyimage.spec.ts | 65 ++++
test/specs/info.spec.ts | 54 +++
test/specs/rescrop.spec.ts | 53 +++
test/specs/resize.spec.ts | 224 ++++++++++++
test/specs/rotate.spec.ts | 51 +++
test/specs/thumbail.spec.ts | 52 +++
test/test.js | 330 ------------------
test/yolo-tall.png | Bin 762 -> 0 bytes
test/yolo.png | Bin 1555 -> 0 bytes
tsconfig.json | 2 +-
types/EasyImage.d.ts | 13 -
types/{Commands => commands}/convert.d.ts | 2 +-
types/{Commands => commands}/crop.d.ts | 2 +-
types/{Commands => commands}/info.d.ts | 0
types/{Commands => commands}/rescrop.d.ts | 0
types/{Commands => commands}/resize.d.ts | 2 +-
types/{Commands => commands}/rotate.d.ts | 2 +-
types/{Commands => commands}/thumbnail.d.ts | 2 +-
types/easyimage.d.ts | 13 +
.../BadDestinationError.d.ts | 0
.../ImageMagickMissingError.d.ts | 0
.../MissingExtensionError.d.ts | 0
.../MissingOptionsError.d.ts | 0
.../{Errors => errors}/UnsupportedError.d.ts | 0
types/{ImageMagick.d.ts => execute.d.ts} | 0
types/{Options.d.ts => options.d.ts} | 0
types/{Utilities.d.ts => utilities.d.ts} | 2 +-
88 files changed, 1344 insertions(+), 616 deletions(-)
delete mode 100644 lib/EasyImage.js
rename lib/{Commands => commands}/convert.js (73%)
rename lib/{Commands => commands}/crop.js (74%)
rename lib/{Commands => commands}/info.js (93%)
rename lib/{Commands => commands}/rescrop.js (80%)
rename lib/{Commands => commands}/resize.js (83%)
rename lib/{Commands => commands}/rotate.js (74%)
rename lib/{Commands => commands}/thumbnail.js (86%)
create mode 100644 lib/easyimage.js
rename lib/{Errors => errors}/BadDestinationError.js (100%)
rename lib/{Errors => errors}/ImageMagickMissingError.js (100%)
rename lib/{Errors => errors}/MissingExtensionError.js (100%)
rename lib/{Errors => errors}/MissingOptionsError.js (100%)
rename lib/{Errors => errors}/UnsupportedError.js (100%)
rename lib/{ImageMagick.js => execute.js} (97%)
rename lib/{Options.js => options.js} (100%)
rename lib/{Utilities.js => utilities.js} (94%)
delete mode 100644 src/EasyImage.ts
rename src/{Commands => commands}/convert.ts (88%)
rename src/{Commands => commands}/crop.ts (88%)
rename src/{Commands => commands}/info.ts (96%)
rename src/{Commands => commands}/rescrop.ts (88%)
rename src/{Commands => commands}/resize.ts (93%)
rename src/{Commands => commands}/rotate.ts (89%)
rename src/{Commands => commands}/thumbnail.ts (93%)
create mode 100644 src/easyimage.ts
rename src/{Errors => errors}/BadDestinationError.ts (100%)
rename src/{Errors => errors}/ImageMagickMissingError.ts (100%)
rename src/{Errors => errors}/MissingExtensionError.ts (100%)
rename src/{Errors => errors}/MissingOptionsError.ts (100%)
rename src/{Errors => errors}/UnsupportedError.ts (100%)
rename src/{ImageMagick.ts => execute.ts} (95%)
rename src/{Options.ts => options.ts} (100%)
rename src/{Utilities.ts => utilities.ts} (92%)
create mode 100644 test/files/tall.png
rename test/{ => files}/test.pdf (100%)
create mode 100644 test/files/wide.jpg
create mode 100644 test/files/wide.png
create mode 100644 test/specs/convert.spec.ts
create mode 100644 test/specs/crop.spec.ts
create mode 100644 test/specs/easyimage.spec.ts
create mode 100644 test/specs/info.spec.ts
create mode 100644 test/specs/rescrop.spec.ts
create mode 100644 test/specs/resize.spec.ts
create mode 100644 test/specs/rotate.spec.ts
create mode 100644 test/specs/thumbail.spec.ts
delete mode 100644 test/test.js
delete mode 100644 test/yolo-tall.png
delete mode 100644 test/yolo.png
delete mode 100644 types/EasyImage.d.ts
rename types/{Commands => commands}/convert.d.ts (87%)
rename types/{Commands => commands}/crop.d.ts (95%)
rename types/{Commands => commands}/info.d.ts (100%)
rename types/{Commands => commands}/rescrop.d.ts (100%)
rename types/{Commands => commands}/resize.d.ts (94%)
rename types/{Commands => commands}/rotate.d.ts (90%)
rename types/{Commands => commands}/thumbnail.d.ts (94%)
create mode 100644 types/easyimage.d.ts
rename types/{Errors => errors}/BadDestinationError.d.ts (100%)
rename types/{Errors => errors}/ImageMagickMissingError.d.ts (100%)
rename types/{Errors => errors}/MissingExtensionError.d.ts (100%)
rename types/{Errors => errors}/MissingOptionsError.d.ts (100%)
rename types/{Errors => errors}/UnsupportedError.d.ts (100%)
rename types/{ImageMagick.d.ts => execute.d.ts} (100%)
rename types/{Options.d.ts => options.d.ts} (100%)
rename types/{Utilities.d.ts => utilities.d.ts} (90%)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 04b8bf0..bba4757 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,9 @@
7. Added `coalesce` option to all commands
8. Added orientation to `info()`
9. Changed `resize()` to not auto-set height from width
+10. Added `getImageMagickVersion()`
+11. Rewrote tests to be more clear
+
2.2.0 - 10-01-2018
------------------
diff --git a/README.md b/README.md
index 95af25b..ed22c45 100644
--- a/README.md
+++ b/README.md
@@ -45,10 +45,10 @@ any of the parameters defined on `IBaseOptions`. For example, to prevent EasyIma
command.
Every command must have a `src` parameter. If you do not specify a `dst`, then a random file will be created. Be sure to clean up randomly created files by
-either moving them to permanent storage, or deleting them. Some command have other required options.
+either moving them to permanent storage, or deleting them. Some commands have other required options.
-The examples below only specify the required arguments. See the [Docs](https://mrkmg.github.io/node-easyimage/index.html) for all available options for each
-command.
+The examples below only specify some of the available arguments. See the [Docs](https://mrkmg.github.io/node-easyimage/index.html) for all available options for
+each command.
### Convert
@@ -179,7 +179,7 @@ ImageMagick.
```
import {getImageMagickVersion} from "easyimage";
-const version = getImageMagickVersion();
+const version = await getImageMagickVersion();
```
## Error Handling
diff --git a/docs/classes/baddestinationerror.html b/docs/classes/baddestinationerror.html
index 08795ef..a3ea99b 100644
--- a/docs/classes/baddestinationerror.html
+++ b/docs/classes/baddestinationerror.html
@@ -1047,7 +1047,7 @@ constructor
diff --git a/docs/classes/imagemagickmissingerror.html b/docs/classes/imagemagickmissingerror.html
index 52a6621..c5230fa 100644
--- a/docs/classes/imagemagickmissingerror.html
+++ b/docs/classes/imagemagickmissingerror.html
@@ -1047,7 +1047,7 @@ constructor
diff --git a/docs/classes/missingextensionerror.html b/docs/classes/missingextensionerror.html
index c8ef300..63c7e09 100644
--- a/docs/classes/missingextensionerror.html
+++ b/docs/classes/missingextensionerror.html
@@ -1047,7 +1047,7 @@ constructor
Parameters
diff --git a/docs/classes/missingoptionserror.html b/docs/classes/missingoptionserror.html
index 983977a..0add8ec 100644
--- a/docs/classes/missingoptionserror.html
+++ b/docs/classes/missingoptionserror.html
@@ -1047,7 +1047,7 @@ constructor
Parameters
diff --git a/docs/classes/unsupportederror.html b/docs/classes/unsupportederror.html
index 37f59d1..962f1c0 100644
--- a/docs/classes/unsupportederror.html
+++ b/docs/classes/unsupportederror.html
@@ -1047,7 +1047,7 @@ constructor
Parameters
diff --git a/docs/globals.html b/docs/globals.html
index 19517f9..50ad2d6 100644
--- a/docs/globals.html
+++ b/docs/globals.html
@@ -1005,9 +1005,9 @@ Installation
any of the parameters defined on IBaseOptions
. For example, to prevent EasyImage from auto-orientating your image, you can pass autoOrient: false
on any
command.
Every command must have a src
parameter. If you do not specify a dst
, then a random file will be created. Be sure to clean up randomly created files by
- either moving them to permanent storage, or deleting them. Some command have other required options.
- The examples below only specify the required arguments. See the Docs for all available options for each
- command.
+ either moving them to permanent storage, or deleting them. Some commands have other required options.
+ The examples below only specify some of the available arguments. See the Docs for all available options for
+ each command.
Convert
The convert() command can convert an image file from one type to another.
import {convert} from "easyimage";
@@ -1092,7 +1092,7 @@ Info
ImageMagick.
import {getImageMagickVersion} from "easyimage";
-const version = getImageMagickVersion();
+const version = await getImageMagickVersion();
Error Handling
There are 5 different types of errors that can be thrown.
@@ -1191,7 +1191,7 @@ convert
-
crop
execute
getImageMagickVersion
info
rescrop
resize
rotate
thumbnail
Installation
any of the parameters defined onIBaseOptions
. For example, to prevent EasyImage from auto-orientating your image, you can passautoOrient: false
on any command.Every command must have a
-src
parameter. If you do not specify adst
, then a random file will be created. Be sure to clean up randomly created files by - either moving them to permanent storage, or deleting them. Some command have other required options.The examples below only specify the required arguments. See the Docs for all available options for each - command.
+ either moving them to permanent storage, or deleting them. Some commands have other required options. +The examples below only specify some of the available arguments. See the Docs for all available options for + each command.
Convert
The convert() command can convert an image file from one type to another.