mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Add optional orientation field
This commit is contained in:
@@ -4,11 +4,11 @@ import sizeOf = require("image-size");
|
||||
|
||||
// Synchronous
|
||||
const dimensions = sizeOf("images/funny-cats.png");
|
||||
console.log(dimensions.width, dimensions.height);
|
||||
console.log(dimensions.width, dimensions.height, dimensions.orientation);
|
||||
|
||||
// Asynchronous
|
||||
sizeOf("images/funny-cats.png", (err, dimensions) => {
|
||||
console.log(dimensions.width, dimensions.height);
|
||||
console.log(dimensions.width, dimensions.height, dimensions.orientation);
|
||||
});
|
||||
|
||||
// From URL
|
||||
|
||||
Vendored
+1
-1
@@ -6,11 +6,11 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
|
||||
interface ImageInfo {
|
||||
width: number;
|
||||
height: number;
|
||||
type: string;
|
||||
orientation?: number;
|
||||
}
|
||||
|
||||
declare function sizeOf(path: string): ImageInfo;
|
||||
|
||||
Reference in New Issue
Block a user