aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorkamtschatka <sschatka@gmail.com>2024-05-12 14:06:41 +0200
committerGitHub <noreply@github.com>2024-05-12 13:06:41 +0100
commitd33be149e661945fe67a9b6c4ff0d1e47917b8cd (patch)
tree1f05995e401e00d71b016bc98131d503625afb36 /apps
parentcbc8dded9970121d003fdcfb71099308acd4f09f (diff)
downloadkarakeep-d33be149e661945fe67a9b6c4ff0d1e47917b8cd.tar.zst
feature: Take full page screenshots #143 (#148)
Added the fullPage flag to take full screen screenshots updated the UI accordingly to properly show the screenshots instead of scaling it down Co-authored-by: kamtschatka <simon.schatka@gmx.at>
Diffstat (limited to 'apps')
-rw-r--r--apps/web/components/dashboard/preview/LinkContentSection.tsx6
-rw-r--r--apps/workers/crawlerWorker.ts3
2 files changed, 6 insertions, 3 deletions
diff --git a/apps/web/components/dashboard/preview/LinkContentSection.tsx b/apps/web/components/dashboard/preview/LinkContentSection.tsx
index 6c51864f..29001c7f 100644
--- a/apps/web/components/dashboard/preview/LinkContentSection.tsx
+++ b/apps/web/components/dashboard/preview/LinkContentSection.tsx
@@ -16,10 +16,12 @@ function ScreenshotSection({ link }: { link: ZBookmarkedLink }) {
return (
<div className="relative h-full min-w-full">
<Image
- fill={true}
alt="screenshot"
src={`/api/assets/${link.screenshotAssetId}`}
- className="object-contain"
+ width={0}
+ height={0}
+ sizes="100vw"
+ style={{ width: "100%", height: "auto" }}
/>
</div>
);
diff --git a/apps/workers/crawlerWorker.ts b/apps/workers/crawlerWorker.ts
index 6b4d39f0..e7ed854b 100644
--- a/apps/workers/crawlerWorker.ts
+++ b/apps/workers/crawlerWorker.ts
@@ -231,10 +231,11 @@ async function crawlPage(jobId: string, url: string) {
// If you change this, you need to change the asset type in the store function.
type: "png",
encoding: "binary",
+ fullPage: serverConfig.crawler.fullPageScreenshot,
}),
]);
logger.info(
- `[Crawler][${jobId}] Finished capturing page content and a screenshot.`,
+ `[Crawler][${jobId}] Finished capturing page content and a screenshot. FullPageScreenshot: ${serverConfig.crawler.fullPageScreenshot}`,
);
return { htmlContent, screenshot, url: page.url() };
} finally {