Tui.image-editor: toDataURL get zoomed image but I need entire image

Created on 23 Mar 2021  路  3Comments  路  Source: nhn/tui.image-editor

I wrote below code to send edited image to server:

$('#btn-save-image').on('click', function (e) {

    var blob = imageEditor.toDataURL();
    var formData = new FormData();
    formData.append('base64Image', blob);
    $.ajax({
        url: '@Url.Action("SaveEditedImage")', // upload url
        type: "POST",
        data: formData,
        processData: false,
        contentType:false,
        success: function (data) {
            showmessage(data);
        },
        error: function () {
            alert('UPLOAD FAILED, PLEASE TRY AGAIN...');
        },
        complete: function () {
            showLoading(false);
        }
    });

    return false;
});

But this code send image with zoom, in the other word toDataUrl cropped my image to zoomed area. But I need to send entire image to server.
Is this a bug or there is something that I don't know?

Question

Most helpful comment

@mbasirati @Al-hamed-Mohammed
Do you want to try the 'resetZoom' API?

All 3 comments

todataurl only send 150 * 300 image I also want to send entire image

@mbasirati @Al-hamed-Mohammed
Do you want to try the 'resetZoom' API?

@mbasirati @Al-hamed-Mohammed
Do you want to try the 'resetZoom' API?

Thank you. I used resetZoom before saving and my problem solved. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aalpgiray picture aalpgiray  路  4Comments

Aleczhang1992 picture Aleczhang1992  路  3Comments

marioviana picture marioviana  路  3Comments

taimaiduc picture taimaiduc  路  3Comments

lightway82 picture lightway82  路  5Comments