20260607 - login, add scene, add hotspot

This commit is contained in:
2026-06-07 21:31:31 +07:00
parent 10d2e07297
commit 5ba6e37039
29 changed files with 1064 additions and 73 deletions
+8 -1
View File
@@ -8,10 +8,17 @@ const sharp = require('sharp');
const resizeTo8K = async (inputPath, outputPath) => {
try {
await sharp(inputPath)
.rotate() // Tự động xoay ảnh dựa trên EXIF orientation
.resize(8192, 4096, {
fit: 'fill' // Ensures the output is exactly 8192x4096
})
.jpeg({ quality: 90 })
.jpeg({
quality: 85,
progressive: false, // Tắt progressive để header đơn giản hơn cho piexifjs
chromaSubsampling: '4:2:0'
})
// Loại bỏ .withMetadata() để Sharp tạo ra file JPEG sạch nhất.
// Điều này giúp piexifjs không bị lỗi "Given data is not jpeg".
.toFile(outputPath);
} catch (error) {
throw new Error(`Sharp image processing failed: ${error.message}`);