Skip to content

Commit

Permalink
Add WebP-Support (#2336)
Browse files Browse the repository at this point in the history
* add webp support
minor fixes
  • Loading branch information
Uzlopak committed Mar 23, 2019
1 parent 0d61792 commit a8d3b26
Show file tree
Hide file tree
Showing 11 changed files with 513 additions and 4 deletions.
1 change: 1 addition & 0 deletions build.browser.conf.js
Expand Up @@ -18,6 +18,7 @@ import './src/modules/outline';
import './src/modules/png_support';
import './src/modules/gif_support';
import './src/modules/bmp_support';
import './src/modules/webp_support';
import './src/modules/setlanguage';
import './src/modules/split_text_to_size';
import './src/modules/standard_fonts_metrics';
Expand Down
2 changes: 1 addition & 1 deletion build.js
Expand Up @@ -47,7 +47,7 @@ function bundle(options) {
}).then((bundle) => {
return bundle.generate({
format: options.format,
name: 'jsPDF'
name: 'jsPDF'
})
}).then(output => {
let code = output.code
Expand Down
135 changes: 135 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -60,7 +60,9 @@
"markdown": "0.5.0",
"rollup": "0.68.2",
"rollup-plugin-babel": "4.3.1",
"rollup-plugin-buble": "^0.19.6",
"rollup-plugin-node-resolve": "3.4.0",
"rollup-plugin-sizes": "^0.5.1",
"uglify-js": "3.4.10"
},
"scripts": {
Expand Down
9 changes: 7 additions & 2 deletions rollup.config.js
@@ -1,5 +1,7 @@
const rollupResolve = require('rollup-plugin-node-resolve');
const rollupBabel = require('rollup-plugin-babel');
const buble = require('rollup-plugin-buble');
const sizes = require('rollup-plugin-sizes');


// Monkey patching filesaver and html2canvas
Expand Down Expand Up @@ -61,9 +63,12 @@ module.exports = {
'BMPDecoder.js': 'BmpDecoder',
'omggif.js': 'GifReader',
'JPEGEncoder.js': 'JPEGEncoder',
'webp_support.js': 'webp_support',
'html2pdf.js': 'html2pdf'
}),
rollupBabel()
rollupBabel(),
buble(),
sizes()
],
output: [
{
Expand All @@ -72,5 +77,5 @@ module.exports = {
file: './lib/index.js',
sourcemap: false
}
],
]
}
3 changes: 3 additions & 0 deletions src/libs/BMPDecoder.js
Expand Up @@ -275,3 +275,6 @@ BmpDecoder.prototype.bit32 = function() {
BmpDecoder.prototype.getData = function() {
return this.data;
};


try { exports.BmpDecoder = BmpDecoder;} catch(e) { } // CommonJS.
4 changes: 3 additions & 1 deletion src/libs/JPEGEncoder.js
Expand Up @@ -723,4 +723,6 @@ function JPEGEncoder(quality) {

init();

};
};

try { exports.JPEGEncoder = JPEGEncoder;} catch(e) { } // CommonJS.

0 comments on commit a8d3b26

Please sign in to comment.