mirror of
https://github.com/lobehub/lobehub
synced 2026-04-21 09:37:28 +00:00
* feat: Redesign doc
* chore: uopdate site
* chore: uopdate site
* chore: uopdate site
* chore: uopdate site
* chore: uopdate site
* feat: Uopdate content
* chore: New doc
* chore: Update content
* chore: Update content
* chore: add images
* chore: add images
* chore: add images
* chore: add images
* feat: Add more images
* feat: Add more images
* fix: Cannot reach end
* chore: Update content
* chore: Update content
* chore: Update content
* chore: Update content
* chore: Update content
* Revise README content and structure
Updated README to reflect changes in project description and removed outdated notes.
* Revise 'Getting Started' and TOC in README
Updated the 'Getting Started' section and modified the table of contents.
* chore: Update content
* Revise README structure and content
Updated the Getting Started section and removed the Table of Contents. Adjusted the Local Development instructions.
* Remove custom themes section from README
Removed section about custom themes from README.
* Update README.md
* Refine introduction and highlight cloud version
Updated wording for clarity and added recommendation for cloud version.
* chore: Update content
* chore: Update content
* chore: Update content
* chore: Update content
* chore: Update content
* chore: Update content
* chore: Update content
* fix: add missing translation
* 🔀 chore: Move README changes to feat/readme branch
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: add missing translation
* chore: update cdn
* docs: add migration guide from v1.x local database to v2.x and update help sections
Signed-off-by: Innei <tukon479@gmail.com>
* fix: add missing translation
* fix: add missing images
* fix: add missing changelogs
* fix: add missing changelogs
* fix: add missing changelogs
* fix: add missing changelogs
* fix: add missing changelogs
* style: update cdn
---------
Signed-off-by: Innei <tukon479@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: canisminor1990 <i@canisminor.cc>
Co-authored-by: Innei <tukon479@gmail.com>
21 lines
565 B
TypeScript
21 lines
565 B
TypeScript
import sharp from 'sharp';
|
|
|
|
const WIDTH = 1600;
|
|
|
|
export const opimized = async (
|
|
inputBuffer: ArrayBuffer,
|
|
width: number = WIDTH,
|
|
): Promise<Buffer> => {
|
|
return await sharp(inputBuffer)
|
|
.resize({ width: width, withoutEnlargement: true })
|
|
.webp()
|
|
.toBuffer();
|
|
};
|
|
|
|
export const opimizedGif = async (inputBuffer: ArrayBuffer): Promise<Buffer> => {
|
|
try {
|
|
return await sharp(inputBuffer, { animated: true }).webp().toBuffer();
|
|
} catch {
|
|
return await sharp(inputBuffer, { animated: true, limitInputPixels: false }).webp().toBuffer();
|
|
}
|
|
};
|