Skip to content

Commit

Permalink
Merge pull request #79 from w3nl/feature/quality-density
Browse files Browse the repository at this point in the history
Test the quality and density
  • Loading branch information
w3nl committed Jul 25, 2024
2 parents 471e0b9 + b9b0a5a commit edb3717
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 2 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ppt-png",
"version": "2.1.1",
"version": "2.1.2",
"description": "Convert ppt to image (png,jpg)",
"files": [
"src/converter.js",
Expand Down
6 changes: 4 additions & 2 deletions src/__tests__/converter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ test('PPT-PNG converter test', async (t) => {
output: 'output/',
options: {
density: 300,
quality: 100
}
quality: 100,
},
});

const result = converter.convert();
Expand All @@ -33,6 +33,8 @@ test('PPT-PNG converter test', async (t) => {
result[0].file.path,
'output/OPW 733 Tienduizend redenen.pdf'
);
assert.strictEqual(converter.density, 300);
assert.strictEqual(converter.quality, 100);
assert.strictEqual(
fileExists('output/OPW 733 Tienduizend redenen.pdf'),
true
Expand Down
6 changes: 4 additions & 2 deletions src/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class Ppt2PngConverter extends Converter {
constructor() {
super();
this.files = [];
this.density = null;
this.quality = null;
}

/**
Expand Down Expand Up @@ -67,8 +69,8 @@ class Ppt2PngConverter extends Converter {
converter.setFiles(files);
converter.setOutput(output);

converter.density = (options && options.density) || undefined;
converter.quality = (options && options.quality) || undefined;
converter.density = options?.density;
converter.quality = options?.quality;

return converter;
}
Expand Down

0 comments on commit edb3717

Please sign in to comment.