You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-12-02 22:49:09 +02:00
All: Refactored REST API to make it testable and to allow further extension
This commit is contained in:
@@ -186,7 +186,11 @@ function shimInit() {
|
||||
const mime = mimeUtils.fromDataUrl(imageDataUrl);
|
||||
await shim.writeImageToFile(image, mime, filePath);
|
||||
} else {
|
||||
throw new Error('Node support not implemented');
|
||||
if (options.cropRect) throw new Error('Crop rect not supported in Node');
|
||||
|
||||
const imageDataURI = require('image-data-uri');
|
||||
const result = imageDataURI.decode(imageDataUrl);
|
||||
await shim.fsDriver().writeFile(filePath, result.dataBuffer, 'buffer');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user