img-editor / Exports / imgEditor
▸ addFrame(input
, printPaperOptions?
, frameOptions?
, output?
, frameWidthFactor?
): Promise
<ProcessedImagesInfo
>
This function adds a frame around the image to change the aspect ratio.
This is helpful when the image you are trying to print has different aspect ratio than the printer paper
Remarks
When buffer is passed as an input this function will return the final, processed image buffer instead of creating a physical file itself
Name | Type | Default value | Description |
---|---|---|---|
input |
string [] | Buffer |
undefined |
file names or a Buffer When buffer is passed to this function the "output" is ignored and the final processed image buffer is returned. |
printPaperOptions |
PrintPaperOptions |
undefined |
information about the printing paper |
frameOptions |
FrameOptions |
undefined |
information about the frame color and image position with the frame (image position is currently not used) |
output |
string |
"." |
output folder |
frameWidthFactor |
number |
0.05 |
width of the frame (smallest dimension x frameWidthFactor) |
Promise
<ProcessedImagesInfo
>
- Information about the operation
▸ resize(files
, width?
, grayscale?
, output?
): Promise
<ProcessedImagesInfo
>
Resizes given file(s) preserving the aspect ratio
Name | Type | Default value | Description |
---|---|---|---|
files |
string [] |
undefined |
list of filenames |
width |
undefined | number |
undefined |
desired output file width |
grayscale |
boolean |
false |
if true img will be grayscaled |
output |
string |
"." |
output folder |
Promise
<ProcessedImagesInfo
>
true if successful