tokimeki-image-editor 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -214,13 +214,21 @@ function handleComplete() {
|
|
|
214
214
|
if (!state.imageData.original || !onComplete)
|
|
215
215
|
return;
|
|
216
216
|
const exportCanvas = applyTransform(state.imageData.original, state.transform, state.adjustments, state.cropArea, state.blurAreas, state.stampAreas);
|
|
217
|
+
const format = state.exportOptions.format === 'jpeg' ? 'image/jpeg' : 'image/png';
|
|
217
218
|
const dataUrl = exportCanvas.toDataURL(state.exportOptions.format === 'jpeg' ? 'image/jpeg' : 'image/png', state.exportOptions.quality);
|
|
218
219
|
// Convert to blob
|
|
219
220
|
exportCanvas.toBlob((blob) => {
|
|
220
221
|
if (blob) {
|
|
221
|
-
|
|
222
|
+
createImageBitmap(blob).then((bitmap) => {
|
|
223
|
+
onComplete(dataUrl, {
|
|
224
|
+
blob: blob,
|
|
225
|
+
width: bitmap.width,
|
|
226
|
+
height: bitmap.height
|
|
227
|
+
});
|
|
228
|
+
bitmap.close();
|
|
229
|
+
});
|
|
222
230
|
}
|
|
223
|
-
},
|
|
231
|
+
}, format, state.exportOptions.quality);
|
|
224
232
|
}
|
|
225
233
|
function handleCancel() {
|
|
226
234
|
if (onCancel) {
|