Skip to content

Commit 82aa6ef

Browse files
authored
Merge pull request #499 from highcharts/bugfix/492-background-color-transparent
bugfix/492-background-color-transparent
2 parents 7dcdfc7 + 5dc2690 commit 82aa6ef

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/export.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ export default async (page, chart, options) => {
382382
if (exportOptions.type === 'svg') {
383383
// SVG
384384
data = await createSVG(page);
385-
} else if (exportOptions.type === 'png' || exportOptions.type === 'jpeg') {
385+
} else if (['png', 'jpeg'].includes(exportOptions.type)) {
386386
// PNG or JPEG
387387
data = await createImage(
388388
page,

lib/utils.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ export const fixType = (type, outfile) => {
102102
if (outfile) {
103103
const outType = outfile.split('.').pop();
104104

105-
// Check if extension has a correct type
106-
if (formats.includes(outType) && type !== outType) {
105+
if (outType === 'jpg') {
106+
type = 'jpeg';
107+
} else if (formats.includes(outType) && type !== outType) {
107108
type = outType;
108109
}
109110
}

0 commit comments

Comments
 (0)