Skip to content

Commit 4f8835a

Browse files
committed
Update ppworker.cjs to use 'convert' command for ImageMagick operations, clarifying background processing for Linux compatibility.
1 parent 6e27e7c commit 4f8835a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/ppworker.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ function generateAdaptiveIcons(input, output) {
2828
const backgroundFile = path.join(dir, 'ic_launcher_background.png')
2929
const foregroundFile = path.join(dir, 'ic_launcher_foreground.png')
3030

31-
// 背景:纯色填充(全覆盖)
31+
// linux只能convert, 背景:纯色填充(全覆盖)
3232
execSync(
33-
`magick -size ${size}x${size} canvas:"${bgColor}" ${backgroundFile}`
33+
`convert -size ${size}x${size} canvas:"${bgColor}" ${backgroundFile}`
3434
)
3535

3636
// 前景大小 = 图标尺寸 × 0.75
3737
const fgSize = Math.round(size * foregroundScale)
3838

3939
// 前景:缩放到安全区域,居中,四周自动留边
4040
execSync(
41-
`magick "${input}" -resize ${fgSize}x${fgSize} ` +
41+
`convert "${input}" -resize ${fgSize}x${fgSize} ` +
4242
`-gravity center -background none -extent ${size}x${size} ${foregroundFile}`
4343
)
4444
}

0 commit comments

Comments
 (0)