mullema / k3-image-clip

Visually crop images with a handy image editor directly inside the panel
MIT License
40 stars 4 forks source link

Image in field does not update after cropping #14

Closed lumpysimon closed 2 years ago

lumpysimon commented 3 years ago

When I crop an image, the image in the field is not updating to show the new crop. Even after clicking Save it doesn't update - the only way to see the new crop is to refresh the page.

Looking in the Inspector Network tool it looks like the request is returning a zero byte file, even though if I go into the media file I can see the file is there.

Screenshot 2021-02-19 at 12 26 40
mullema commented 3 years ago

What Kirby and Plugin Version are you using?

lumpysimon commented 3 years ago

Kirby 3.5.3 Image Clip: I've installed the plugin as a git submodule, so it's the latest version of the master branch

mullema commented 3 years ago

Hm I cannot reproduce this one. What webserver are you using? What size are the images?

lumpysimon commented 3 years ago

I'm using Valet with PHP 7.4.14 on MacOS. The image is 1500x1000 (but it's the same whatever the image size).

Here's my blueprint:

fields:
  text:
    label: text
    type: textarea
    size: small
  pic:
    label: Pic
    type: image-clip
    clip:
      minheight: 400
      minwidth: 400
      ratio: fixed
    layout: cards

And here's how I reproduce it:

  1. Upload image
  2. Click the crop icon
  3. Crop and click 'OK'
  4. Image in the field does not change.
  5. Click Save.
  6. Image doesn't change.
  7. Reload the page, the field now shows the cropped image.
  8. Repeating from step 2 gives the exact same issue.

I've noticed the network inspector is slightly different this time, I'm seeing the NS_BINDING_ABORTED status:

Screenshot 2021-02-19 at 13 56 34
lumpysimon commented 3 years ago

Another update: I've tried in Firefox and Chrome. In Chrome it seems to never work (shows a status of 'canceled', but in Firefox it seems to work on average maybe once out of every three or four times (shows status NS_BINDING_ABORTED).

mullema commented 3 years ago

I cannot reproduce this issue on Windows10 with Laragon 4.0.16. Tested with Firefox, Chrome and Edge.

Have you tried on your production environment?

lumpysimon commented 3 years ago

Not yet, as the project is in very early development. I'll be setting up a staging environment in the next week or so which will be the same setup as production will be, so I'll test it there and let you know.

mullema commented 3 years ago

@lumpysimon any feedback on this?