Options are required (apparently)

This commit is contained in:
Edward Sammut Alessi
2019-04-15 12:28:38 +02:00
parent fc26279044
commit 9992ff5bf0
2 changed files with 4 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ export interface RotateDimensions {
export function rotate(
path_or_buffer: string | Buffer,
options?: RotateOptions,
options: RotateOptions,
): Promise<{
buffer: Buffer;
orientation: number;
@@ -40,7 +40,7 @@ export function rotate(
export function rotate(
path_or_buffer: string | Buffer,
options?: RotateOptions,
options: RotateOptions,
module_callback?: (
error: CustomError | null,
buffer: Buffer,

View File

@@ -1,7 +1,7 @@
import * as jo from "jpeg-autorotate";
jo.rotate("img.jpg");
jo.rotate(new Buffer(""));
jo.rotate("img.jpg", {});
jo.rotate(new Buffer(""), {});
jo.rotate(new Buffer(""), { quality: 50 });
jo.rotate("img.jpg", { quality: 100 }, (error, buffer, orientation, dimensions, quality) => {
if (error && error.code === jo.errors.correct_orientation) {