Foundry376/Mailspring · error
Cannot find ImageMagick
Error message
Cannot find ImageMagick
What it means
convertToPNG warns (does not throw) that the ImageMagick 'convert' binary produced no version output, so icon-to-PNG conversion cannot proceed. Used on Linux when synthesizing window/taskbar icons from theme icon files; without ImageMagick the converted tmp file cannot be created.
Source
Thrown at app/src/linux-theme-utils.ts:302
throw Error('getIcon only works on linux');
}
return getIconPath(iconName, size, context, scale);
}
/**
* Convert any icon to a png using ImageMagick. If ImageMagick is not present the icon cannot be
* converted.
*
* @param {string} iconName to name the tmp file
* @param {string} iconPath to the original icon to be converted
* @returns {string} path to the converted tmp file
*/
function convertToPNG(iconName: string, iconPath: string) {
try {
const version = execSync('convert --version').toString().trim();
if (!version) {
console.warn('Cannot find ImageMagick');
return null;
}
const tmpPath = path.join(os.tmpdir(), `${iconName}-${crypto.randomUUID()}.png`);
execSync(`convert ${iconPath} -transparent white ${tmpPath}`);
return tmpPath;
} catch (error) {
console.warn(error);
}
return null;
}
export { convertToPNG, getIcon, getIconThemeName, getThemeName, Context };
View on GitHub (pinned to 648c685d60)
Solutions
- Install ImageMagick (e.g. apt install imagemagick, dnf install ImageMagick)
- Verify 'convert --version' works in a terminal
- Skip custom icon conversion; the app falls back to a default icon
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at app/src/linux-theme-utils.ts:302 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Foundry376/Mailspring@648c685d60 (2026-09-03).
Data as JSON: /api/errors/04e2176ddf6fd382.
Report an issue: GitHub.