scaleflex / filerobot-image-editor

Edit, resize, and filter any image! Any questions or issues, please report to https://github.com/scaleflex/filerobot-image-editor/issues
MIT License
1.34k stars 340 forks source link

designState does not consider scale settings (dpi) / different window size correctly #259

Open robertstrasser opened 2 years ago

robertstrasser commented 2 years ago

On my DEV system, I'm using a 4k display with a 150% scale. I would also like to use the designState to enable the user to edit already changed images by loading the original image and apply the previous designState to the FilerobotImageEditor:

let state = null;
if(this._image.dataset.changes){
    // restore designState from JSON string
    state = JSON.parse(this._image.dataset.state);
}

const config = {
    source             : this._image.dataset.image,
    onSave             : (editedImageObject, designState) => {
        return new Promise((resolve, reject) => {
            let data = new FormData();
            data.append('changes', JSON.stringify(designState));    // add designState as JSON string and send it to server
            resolve(fetch(this._image.dataset.target, {
                method : 'POST',
                body   : data
            }));
        });
    },
    loadableDesignState: state,
    language           : 'de'
};

Editing the images on the same device with the same scale/window size works as expected. But using another device or reducing the window size, the designState does not consider the scale correctly.

I'm using the latest version v4.3.7.

Example:

  1. Image edited on 150% scale: image

  2. Open the image on a device with 100% scale using the designState from step 1 (e.g. iPad Air via Chrome device emulation): image

  3. Open the image on the device with 150% scale but with a reduced window size: image

SaraZoarob commented 1 year ago

hi @robertstrasser, we will check this and get back to you

Ninja-Xu commented 1 year ago

I have the same problem,do you have any solutions?

NicoleCH35 commented 12 months ago

I am also experiencing this issue

satishgoml commented 8 months ago

Any updates on this?

AhmeeedMostafa commented 8 months ago

No updates yet, not enough capacity if we have some contributor consider This would be good