Skip to content

Commit

Permalink
Update disk icon to latest version (sindresorhus#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cykelero authored Jul 29, 2022
1 parent 43e5418 commit 4833280
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compose-icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ async function composeIcon(type, appIcon, mountIcon, composedIcon) {
appIcon = appIcon.out('-matte').out('-virtual-pixel', 'transparent').out('-distort', 'Perspective', `1,1 ${appIconSize.width * 0.08},1 ${appIconSize.width},1 ${appIconSize.width * 0.92},1 1,${appIconSize.height} 1,${appIconSize.height} ${appIconSize.width},${appIconSize.height} ${appIconSize.width},${appIconSize.height}`);

// Resize the app icon to fit it inside the mount icon, aspect ration should not be kept to create the perspective illution
appIcon = appIcon.resize(mountIconSize.width / 1.7, mountIconSize.height / 1.78, '!');
appIcon = appIcon.resize(mountIconSize.width / 1.58, mountIconSize.height / 1.82, '!');

const tempAppIconPath = tempy.file({extension: 'png'});
await promisify(appIcon.write.bind(appIcon))(tempAppIconPath);

// Compose the two icons
const iconGravityFactor = mountIconSize.height * 0.155;
const iconGravityFactor = mountIconSize.height * 0.063;
mountIcon = mountIcon.composite(tempAppIconPath).gravity('Center').geometry(`+0-${iconGravityFactor}`);

composedIcon[type] = await promisify(mountIcon.toBuffer.bind(mountIcon))();
Expand Down
Binary file modified disk-icon.icns
Binary file not shown.

0 comments on commit 4833280

Please sign in to comment.