@@ -10,12 +10,12 @@ export type Extents = {
10
10
11
11
/**
12
12
* Get the bounding box of an image.
13
- * @param buffer The ArrayBuffer of the image to get the bounding box of.
13
+ * @param buffer The ArrayBufferLike of the image to get the bounding box of.
14
14
* @param width The width of the image.
15
15
* @param height The height of the image.
16
16
* @returns The minimum and maximum x and y values of the image's bounding box, or null if the image has no pixels.
17
17
*/
18
- const getImageDataBboxArrayBuffer = ( buffer : ArrayBuffer , width : number , height : number ) : Extents | null => {
18
+ const getImageDataBboxArrayBufferLike = ( buffer : ArrayBufferLike , width : number , height : number ) : Extents | null => {
19
19
let minX = width ;
20
20
let minY = height ;
21
21
let maxX = - 1 ;
@@ -50,7 +50,7 @@ const getImageDataBboxArrayBuffer = (buffer: ArrayBuffer, width: number, height:
50
50
51
51
export type GetBboxTask = {
52
52
type : 'get_bbox' ;
53
- data : { id : string ; buffer : ArrayBuffer ; width : number ; height : number } ;
53
+ data : { id : string ; buffer : ArrayBufferLike ; width : number ; height : number } ;
54
54
} ;
55
55
56
56
type TaskWithTimestamps < T extends Record < string , unknown > > = T & { started : number | null ; finished : number | null } ;
@@ -95,7 +95,7 @@ function processNextTask() {
95
95
// Process the task
96
96
if ( task . type === 'get_bbox' ) {
97
97
const { buffer, width, height, id } = task . data ;
98
- const extents = getImageDataBboxArrayBuffer ( buffer , width , height ) ;
98
+ const extents = getImageDataBboxArrayBufferLike ( buffer , width , height ) ;
99
99
const result : ExtentsResult = {
100
100
type : 'extents' ,
101
101
data : { id, extents } ,
0 commit comments