feat: 添加 codebuddy skills (image-tools, product-detail-designer, sku设计) 及商品实拍图样式优化
This commit is contained in:
27
.codebuddy/skills/image-tools/scripts/check-image-info.js
Normal file
27
.codebuddy/skills/image-tools/scripts/check-image-info.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const sharp = require('sharp');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
async function checkImageInfo() {
|
||||
const imageDir = path.join(__dirname, '产品', '飞牛 NAS', 'fyd-亚克力机箱 - 单', '详情', 'image');
|
||||
|
||||
const imageFiles = fs.readdirSync(imageDir).filter(file => file.endsWith('.jpg'));
|
||||
|
||||
console.log('📸 图片信息检查\n');
|
||||
|
||||
for (const imageFile of imageFiles) {
|
||||
const imagePath = path.join(imageDir, imageFile);
|
||||
const metadata = await sharp(imagePath).metadata();
|
||||
|
||||
console.log(`${imageFile}:`);
|
||||
console.log(` 宽度: ${metadata.width}px`);
|
||||
console.log(` 高度: ${metadata.height}px`);
|
||||
console.log(` 格式: ${metadata.format}`);
|
||||
console.log('');
|
||||
}
|
||||
}
|
||||
|
||||
checkImageInfo().catch(error => {
|
||||
console.error('💥 检查过程出错:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user