Skip to content

Commit 7641643

Browse files
fix: bookmark images cover
1 parent b39d8b1 commit 7641643

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

examples/full/lib/preview-images.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,18 @@ async function createPreviewImage(url: string): Promise<PreviewImage | null> {
3333
try {
3434
const { body } = await got(url, { responseType: 'buffer' })
3535
const result = await lqip(body)
36-
console.log('lqip', result.metadata)
36+
console.log('lqip', { originalUrl: url, ...result.metadata })
3737

3838
return {
3939
originalWidth: result.metadata.originalWidth,
4040
originalHeight: result.metadata.originalHeight,
4141
dataURIBase64: result.metadata.dataURIBase64
4242
}
4343
} catch (err) {
44+
if (err.message === 'Input buffer contains unsupported image format') {
45+
return null
46+
}
47+
4448
console.warn('failed to create preview image', url, err.message)
4549
return null
4650
}

packages/react-notion-x/src/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,10 @@ svg.notion-page-icon {
10481048
height: 100%;
10491049
}
10501050

1051+
.notion-bookmark-image span {
1052+
max-height: 100%;
1053+
}
1054+
10511055
.notion-column .notion-bookmark-image {
10521056
display: none;
10531057
}

0 commit comments

Comments
 (0)