{"record":{"id":"04e2176ddf6fd382","repo":"Foundry376/Mailspring","slug":"cannot-find-imagemagick","errorCode":null,"errorMessage":"Cannot find ImageMagick","messagePattern":"Cannot find ImageMagick","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/linux-theme-utils.ts","lineNumber":302,"sourceCode":"    throw Error('getIcon only works on linux');\n  }\n\n  return getIconPath(iconName, size, context, scale);\n}\n\n/**\n * Convert any icon to a png using ImageMagick. If ImageMagick is not present the icon cannot be\n * converted.\n *\n * @param {string} iconName to name the tmp file\n * @param {string} iconPath to the original icon to be converted\n * @returns {string} path to the converted tmp file\n */\nfunction convertToPNG(iconName: string, iconPath: string) {\n  try {\n    const version = execSync('convert --version').toString().trim();\n    if (!version) {\n      console.warn('Cannot find ImageMagick');\n      return null;\n    }\n    const tmpPath = path.join(os.tmpdir(), `${iconName}-${crypto.randomUUID()}.png`);\n    execSync(`convert ${iconPath} -transparent white ${tmpPath}`);\n    return tmpPath;\n  } catch (error) {\n    console.warn(error);\n  }\n  return null;\n}\n\nexport { convertToPNG, getIcon, getIconThemeName, getThemeName, Context };\n","sourceCodeStart":284,"sourceCodeEnd":315,"githubUrl":"https://github.com/Foundry376/Mailspring/blob/648c685d602ece6bb00c22534b8734de6ac644b3/app/src/linux-theme-utils.ts#L284-L315","documentation":"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.","triggerScenarios":"Thrown at app/src/linux-theme-utils.ts:302 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"648c685d602ece6bb00c22534b8734de6ac644b3","analyzedAt":"2026-09-03T02:00:24.311Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}