Fix EMF to PNG conversion issue #362
- Add EMF-specific handling in ImageMagick converter to avoid LibreOffice delegate issues - Disable EMF delegate and set proper conversion parameters (density: 300, background: white, alpha: remove) - Prioritize Inkscape over ImageMagick for EMF files as it handles them natively - Resolves LibreOffice delegate command failures when converting EMF files Fixes #362
This commit is contained in:
parent
fe22b2f8fb
commit
0e94fe354f
2 changed files with 12 additions and 4 deletions
|
|
@ -460,6 +460,13 @@ export function convert(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle EMF files specifically to avoid LibreOffice delegate issues
|
||||||
|
if (fileType === "emf") {
|
||||||
|
// Use direct conversion without delegates for EMF files
|
||||||
|
inputArgs = ["-define", "emf:delegate=false", "-density", "300"];
|
||||||
|
outputArgs = ["-background", "white", "-alpha", "remove"];
|
||||||
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
execFile(
|
execFile(
|
||||||
"magick",
|
"magick",
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,11 @@ const properties: Record<
|
||||||
) => unknown;
|
) => unknown;
|
||||||
}
|
}
|
||||||
> = {
|
> = {
|
||||||
|
// Prioritize Inkscape for EMF files as it handles them better than ImageMagick
|
||||||
|
inkscape: {
|
||||||
|
properties: propertiesInkscape,
|
||||||
|
converter: convertInkscape,
|
||||||
|
},
|
||||||
libjxl: {
|
libjxl: {
|
||||||
properties: propertiesLibjxl,
|
properties: propertiesLibjxl,
|
||||||
converter: convertLibjxl,
|
converter: convertLibjxl,
|
||||||
|
|
@ -87,10 +92,6 @@ const properties: Record<
|
||||||
properties: propertiesGraphicsmagick,
|
properties: propertiesGraphicsmagick,
|
||||||
converter: convertGraphicsmagick,
|
converter: convertGraphicsmagick,
|
||||||
},
|
},
|
||||||
inkscape: {
|
|
||||||
properties: propertiesInkscape,
|
|
||||||
converter: convertInkscape,
|
|
||||||
},
|
|
||||||
assimp: {
|
assimp: {
|
||||||
properties: propertiesassimp,
|
properties: propertiesassimp,
|
||||||
converter: convertassimp,
|
converter: convertassimp,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue