Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

fix: serve unoptimized nextjs images

Mohamed Bassem61a2bdebde2b
diff --git a/apps/web/components/dashboard/bookmarks/AssetCard.tsx b/apps/web/components/dashboard/bookmarks/AssetCard.tsx
index d20e7285..713bdd9a 100644
--- a/apps/web/components/dashboard/bookmarks/AssetCard.tsx
+++ b/apps/web/components/dashboard/bookmarks/AssetCard.tsx
@@ -28,6 +28,7 @@ function AssetImage({
alt="asset"
src={getAssetUrl(bookmarkedAsset.assetId)}
fill={true}
+ unoptimized
className={className}
/>
</Link>
@@ -53,6 +54,7 @@ function AssetImage({
alt="asset"
src={getAssetUrl(screenshotAssetId)}
fill={true}
+ unoptimized
className={className}
/>
</Link>
diff --git a/apps/web/components/dashboard/bookmarks/LinkCard.tsx b/apps/web/components/dashboard/bookmarks/LinkCard.tsx
index b0ddfac3..230baf02 100644
--- a/apps/web/components/dashboard/bookmarks/LinkCard.tsx
+++ b/apps/web/components/dashboard/bookmarks/LinkCard.tsx
@@ -65,7 +65,7 @@ function LinkImage({
if (isBookmarkStillCrawling(bookmark)) {
img = imgComponent("/blur.avif", false);
} else if (imageDetails) {
- img = imgComponent(imageDetails.url, !imageDetails.localAsset);
+ img = imgComponent(imageDetails.url, true);
} else {
// No image found
// A dummy white pixel for when there's no image.
diff --git a/apps/web/components/dashboard/bookmarks/TextCard.tsx b/apps/web/components/dashboard/bookmarks/TextCard.tsx
index f8d4851b..1dabbf9a 100644
--- a/apps/web/components/dashboard/bookmarks/TextCard.tsx
+++ b/apps/web/components/dashboard/bookmarks/TextCard.tsx
@@ -53,6 +53,7 @@ export default function TextCard({
<Image
alt="card banner"
fill={true}
+ unoptimized
className={cn("flex-1", className)}
src={getAssetUrl(banner.id)}
/>
diff --git a/apps/web/components/dashboard/preview/AssetContentSection.tsx b/apps/web/components/dashboard/preview/AssetContentSection.tsx
index 5cab86bd..88383855 100644
--- a/apps/web/components/dashboard/preview/AssetContentSection.tsx
+++ b/apps/web/components/dashboard/preview/AssetContentSection.tsx
@@ -51,6 +51,7 @@ function PDFContentSection({ bookmark }: { bookmark: ZBookmark }) {
alt="screenshot"
src={getAssetUrl(screenshot)}
fill={true}
+ unoptimized
className="object-contain"
/>
</div>
@@ -94,6 +95,7 @@ function ImageContentSection({ bookmark }: { bookmark: ZBookmark }) {
<Image
alt="asset"
fill={true}
+ unoptimized
className="object-contain"
src={getAssetUrl(bookmark.content.assetId)}
/>
diff --git a/apps/web/components/dashboard/preview/LinkContentSection.tsx b/apps/web/components/dashboard/preview/LinkContentSection.tsx
index 29bd9500..e692c5b5 100644
--- a/apps/web/components/dashboard/preview/LinkContentSection.tsx
+++ b/apps/web/components/dashboard/preview/LinkContentSection.tsx
@@ -83,6 +83,7 @@ function ScreenshotSection({ link }: { link: ZBookmarkedLink }) {
src={`/api/assets/${link.screenshotAssetId}`}
width={0}
height={0}
+ unoptimized
sizes="100vw"
style={{ width: "100%", height: "auto" }}
/>
diff --git a/apps/web/components/dashboard/preview/TextContentSection.tsx b/apps/web/components/dashboard/preview/TextContentSection.tsx
index 1342b9cf..98563b53 100644
--- a/apps/web/components/dashboard/preview/TextContentSection.tsx
+++ b/apps/web/components/dashboard/preview/TextContentSection.tsx
@@ -23,6 +23,7 @@ export function TextContentSection({ bookmark }: { bookmark: ZBookmark }) {
src={getAssetUrl(banner.id)}
width={0}
height={0}
+ unoptimized
layout="fill"
objectFit="cover"
/>