1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Clipper: Fixed importing certain images with sources that contain brackets

This commit is contained in:
Laurent Cozic
2018-09-24 20:15:23 +01:00
parent 312c7f2d27
commit f82dfde6f4
6 changed files with 96 additions and 11 deletions

View File

@ -173,7 +173,7 @@ function shimInit() {
if (shim.isElectron()) {
const nativeImage = require('electron').nativeImage;
let image = nativeImage.createFromDataURL(imageDataUrl);
if (image.isEmpty()) throw new Error('Could not convert data URL to image');
if (image.isEmpty()) throw new Error('Could not convert data URL to image'); // Would throw for example if the image format is no supported (eg. image/gif)
if (options.cropRect) {
// Crop rectangle values need to be rounded or the crop() call will fail
const c = options.cropRect;