Skip to content

Conversation

@cybervoid0
Copy link
Owner

generate blur data async on the backend

@cybervoid0 cybervoid0 requested a review from Copilot October 11, 2025 01:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates blur data generation from synchronous client-side processing to asynchronous server-side processing using Sharp library for better performance and user experience.

  • Removed client-side getThumbnailBase64 function and moved blur generation to server
  • Implemented new server-side blur data generation using Sharp with async processing via Next.js after() function
  • Updated all image creation workflows to use the new async blur data generation pattern

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
utils/index.ts Removed export of deprecated getThumbnailBase64 function
utils/images.ts Removed client-side getThumbnailBase64 function implementation
server/images/blur.ts New server-side blur data generation using Sharp library
server/images/actions.ts Added async blur data creation workflow with database updates
scripts/tunnel.ts Increased tunnel establishment timeout from 2s to 5s
components/ui/spinner.tsx Changed LoadingOverlay positioning from absolute to fixed
components/elements/image/image.tsx Added conditional blur placeholder logic
Multiple schema files Updated image creation to use new async createImagesInDb function
Brand edit components Improved loading states and image deletion handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

.resize(64, 64, { fit: 'inside' }) // Larger size for more detail
.blur(1.5) // Slightly less blur to preserve more detail
.png({
quality: 60, // Higher quality for better colors
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quality option is not valid for PNG format in Sharp. This option is only available for JPEG format. Consider removing this line or switching to JPEG format if quality control is needed.

Suggested change
quality: 60, // Higher quality for better colors

Copilot uses AI. Check for mistakes.
@cybervoid0 cybervoid0 merged commit 36b5c43 into master Oct 11, 2025
1 check failed
@cybervoid0 cybervoid0 deleted the regenerate-blur-images branch October 11, 2025 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants