@imageengine/imageengine-helpers
Advanced tools
+1
-1
| { | ||
| "name": "@imageengine/imageengine-helpers", | ||
| "version": "0.0.3", | ||
| "version": "0.0.4", | ||
| "description": "A set of helper functions to generate ImageEngine custom urls with valid directives", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/imgeng/imageengine-helpers", |
+47
-2
@@ -7,6 +7,51 @@ A tiny set of helpers and TS types for building [ImageEngine](https://imageengine.io) query URLs for your distribution. | ||
| `npm install imageengine-helpers` | ||
| `npm install @imageengine/imageengine-helpers` | ||
| View on [npm](https://www.npmjs.com/package/imageengine-helpers) | ||
| View on [npm](https://www.npmjs.com/package/@imageengine/imageengine-helpers) | ||
| Types: | ||
| ``` | ||
| export type IEFormat = | ||
| "png" | | ||
| "gif" | | ||
| "jpg" | | ||
| "bmp" | | ||
| "webp" | | ||
| "jp2" | | ||
| "svg" | | ||
| "mp4" | | ||
| "jxr" | | ||
| "avif" ; | ||
| export type IEFit = | ||
| "stretch" | | ||
| "box" | | ||
| "letterbox" | | ||
| "cropbox" ; | ||
| export interface IEDirectives { | ||
| width?: number; // the intrinsic width of the final image | ||
| height?: number; // the intrinsic height of the final image | ||
| auto_width_fallback?: number; // if WURFL device detection should be tried with a | ||
| // fallback value in case it fails | ||
| scale_to_screen_width?: number; // 0-100 float | ||
| crop?: [number, number, number, number]; // [width, height, left, top] | ||
| format?: IEFormat; // the output format | ||
| fit?: IEFit; // the image fit in relation to the provided width/height | ||
| compression?: number; // 0-100 | ||
| sharpness?: number; // 0-100 | ||
| rotate?: number; // -360-360 | ||
| inline?: true; // convert image to dataURL | ||
| keep_meta?: true; // keep EXIF image data | ||
| no_optimization?: true; // don't apply IE optimizations | ||
| }; | ||
| ``` | ||
| For instance: | ||
@@ -13,0 +58,0 @@ |
7773
18.31%90
100%