Skip to content

Commit 0906011

Browse files
Update src/tools/pdf/extract-images.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 8f93730 commit 0906011

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/tools/pdf/extract-images.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ async function convertRawImageToBase64(
159159

160160
try {
161161
// Try to dynamically import sharp
162-
const sharpModule = await eval('import("sharp")') as any;
163-
const sharp = sharpModule.default;
162+
const sharp = (await import('sharp')).default;
164163

165164
// sharp takes Buffer, Uint8Array, etc.
166165
// unpdf returns Uint8ClampedArray, which works with Buffer.from()

0 commit comments

Comments
 (0)