Browse Source

perf: resize thumbnails to 288px for better quality at display size

- Resize workflow screenshot thumbnails from 1024px to 288px
- Create resized primary thumbnails (288px) from large sample images
- Use static paths instead of dynamic content lookup
- 288px = 2x retina for 144px display

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 6 months ago
parent
commit
0b68657203
  1. BIN
      public/template-thumbnails/background-swap.png
  2. BIN
      public/template-thumbnails/color-variations.png
  3. BIN
      public/template-thumbnails/model-product.png
  4. BIN
      public/template-thumbnails/primary/background-swap.jpg
  5. BIN
      public/template-thumbnails/primary/color-variations.jpg
  6. BIN
      public/template-thumbnails/primary/model-product.jpg
  7. BIN
      public/template-thumbnails/primary/product-shot.jpg
  8. BIN
      public/template-thumbnails/primary/scene-composite.jpg
  9. BIN
      public/template-thumbnails/primary/style-transfer.png
  10. BIN
      public/template-thumbnails/product-shot.png
  11. BIN
      public/template-thumbnails/scene-composite.png
  12. BIN
      public/template-thumbnails/style-transfer.png
  13. 25
      src/components/quickstart/TemplateExplorerView.tsx

BIN
public/template-thumbnails/background-swap.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 795 KiB

After

Width:  |  Height:  |  Size: 19 KiB

BIN
public/template-thumbnails/color-variations.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 KiB

After

Width:  |  Height:  |  Size: 16 KiB

BIN
public/template-thumbnails/model-product.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 746 KiB

After

Width:  |  Height:  |  Size: 21 KiB

BIN
public/template-thumbnails/primary/background-swap.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/template-thumbnails/primary/color-variations.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
public/template-thumbnails/primary/model-product.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
public/template-thumbnails/primary/product-shot.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
public/template-thumbnails/primary/scene-composite.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
public/template-thumbnails/primary/style-transfer.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
public/template-thumbnails/product-shot.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 719 KiB

After

Width:  |  Height:  |  Size: 22 KiB

BIN
public/template-thumbnails/scene-composite.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 46 KiB

BIN
public/template-thumbnails/style-transfer.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 758 KiB

After

Width:  |  Height:  |  Size: 19 KiB

25
src/components/quickstart/TemplateExplorerView.tsx

@ -2,7 +2,7 @@
import { useState, useEffect, useCallback, useMemo, useRef } from "react"; import { useState, useEffect, useCallback, useMemo, useRef } from "react";
import { WorkflowFile } from "@/store/workflowStore"; import { WorkflowFile } from "@/store/workflowStore";
import { getAllPresets, PRESET_TEMPLATES, getTemplateContent } from "@/lib/quickstart/templates"; import { getAllPresets, PRESET_TEMPLATES } from "@/lib/quickstart/templates";
import { QuickstartBackButton } from "./QuickstartBackButton"; import { QuickstartBackButton } from "./QuickstartBackButton";
import { TemplateCard } from "./TemplateCard"; import { TemplateCard } from "./TemplateCard";
import { CommunityWorkflowMeta, TemplateCategory, TemplateMetadata } from "@/types/quickstart"; import { CommunityWorkflowMeta, TemplateCategory, TemplateMetadata } from "@/types/quickstart";
@ -69,20 +69,17 @@ export function TemplateExplorerView({
return metadata; return metadata;
}, []); }, []);
// Get primary thumbnail from template content (first image) // Primary thumbnails (resized content images - 288px for 2x retina)
const primaryThumbnails = useMemo(() => { const primaryThumbnails: Record<string, string> = {
const images: Record<string, string | undefined> = {}; "product-shot": "/template-thumbnails/primary/product-shot.jpg",
PRESET_TEMPLATES.forEach((template) => { "model-product": "/template-thumbnails/primary/model-product.jpg",
const content = getTemplateContent(template.id, "full"); "color-variations": "/template-thumbnails/primary/color-variations.jpg",
if (content?.images) { "background-swap": "/template-thumbnails/primary/background-swap.jpg",
const imageUrls = Object.values(content.images).map((img) => img.url); "style-transfer": "/template-thumbnails/primary/style-transfer.png",
images[template.id] = imageUrls[0]; "scene-composite": "/template-thumbnails/primary/scene-composite.jpg",
} };
});
return images;
}, []);
// Hover thumbnails (workflow screenshots) // Hover thumbnails (workflow screenshots - 288px)
const hoverThumbnails: Record<string, string> = { const hoverThumbnails: Record<string, string> = {
"product-shot": "/template-thumbnails/product-shot.png", "product-shot": "/template-thumbnails/product-shot.png",
"model-product": "/template-thumbnails/model-product.png", "model-product": "/template-thumbnails/model-product.png",

Loading…
Cancel
Save