Skip to content

Commit

Permalink
chore: fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Mar 3, 2025
1 parent 85cd7b9 commit 3259694
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ export function apply(ctx: Context, config: Config) {
// Gets all files in the ZIP file
const zipEntries = zip.getEntries()
const firstImageBuffer = zip.readFile(zipEntries[0])
const b64 = Buffer.from(firstImageBuffer).toString('base64')
const b64 = firstImageBuffer.toString('base64')
return forceDataPrefix(b64, 'image/png')
}
return forceDataPrefix(res.data?.trimEnd().slice(27))
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface Size {

export function getImageSize(buffer: ArrayBuffer): Size {
if (typeof Buffer !== 'undefined') {
return imageSize(Buffer.from(buffer))
return imageSize(new Uint8Array(buffer))
}
const blob = new Blob([buffer])
const image = new Image()
Expand Down

0 comments on commit 3259694

Please sign in to comment.