You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new DownloadHandler for Image components in Vaadin 24.8.x appears to be breaking the cropping feature. If you change an Image to utilize the new DownloadHandler version of the .setSrc() method as opposed to the now deprecated StreamResource version, the cropping dialog is broken. It displays a broken image instead of the image associated with the component.
I've been trying to debug this, but I haven't yet determined a root cause.
I am testing using a button to invoke the cropping, and I can confirm that the Handler has already been invoked and the image is displayed on my page.
Hello. The ImageCrop(Image) constructor currently only supports images with a fixed src, not dynamic resources like DownloadHandler or StreamResource.
We have created issue #24 to deprecate the current constructor. This issue will remain open to track the future implementation of support for DownloadHandler and StreamResource.
I cannot reproduce this issue with version 1.2.2 of ImageCrop. I also have a Vaadin application and recently upgraded it to the new DownloadHandler API and I can see the preview image and the cropping rectangle without any problems. I cannot test the cropping action per se, because for that I need some features I implemented in a fork (https://github.com/iSYS-Software/ImageCrop).
Anyway, to perhaps help debug this, here is my Vaadin Code to set the source of the preview image:
Adding to my previous comment: I have now tested the newly released 1.3.0 of ImageCrop and found no issues. I could also test cropping per se now and my test suite is green. So I am now replacing my fork with the upstream again and suspect this issue could be closed, unless the original reporter still sees a problem.
Thanks @realulim for the feedback! However, this issue shouldn't be closed yet: the problem still happens in scenarios where the original Image is not attached or visible (e.g. when it's only used to build the cropper), both in Vaadin 24.8 and 25. We are going to work on it.
As mentioned before by Javier, the idea is:
Add ImageCrop(DownloadHandler) and setImageSrc(DownloadHandler), so the resource is registered to the ImageCrop itself instead of depending on another Image.
Add the equivalent StreamResource overloads. Since StreamResource is deprecated for removal since Vaadin 24.8, it will likely be deprecated too, mirroring Image.setSrc(AbstractStreamResource).
A quick update on the plan above: this is being addressed in #37.
It will be released in 2.0.0, which requires Vaadin 24.8+ (and supports Vaadin 25), since DownloadHandler is only available from Vaadin 24.8 on. Version 1.x remains available for earlier Vaadin 24 versions.
2.0.0 works only with the new API, so the StreamResource overloads won't be added after all.
The deprecated ImageCrop(Image) constructor is removed in 2.0.0. Use ImageCrop(String) or ImageCrop(DownloadHandler) instead.
Activity
javier-godoy commentedon Aug 4, 2025
Hello. The
ImageCrop(Image)constructor currently only supports images with a fixedsrc, not dynamic resources likeDownloadHandlerorStreamResource.We have created issue #24 to deprecate the current constructor. This issue will remain open to track the future implementation of support for
DownloadHandlerandStreamResource.realulim commentedon Sep 29, 2026
I cannot reproduce this issue with version 1.2.2 of ImageCrop. I also have a Vaadin application and recently upgraded it to the new DownloadHandler API and I can see the preview image and the cropping rectangle without any problems. I cannot test the cropping action per se, because for that I need some features I implemented in a fork (https://github.com/iSYS-Software/ImageCrop).
Anyway, to perhaps help debug this, here is my Vaadin Code to set the source of the preview image:
realulim commentedon Sep 30, 2026
Adding to my previous comment: I have now tested the newly released 1.3.0 of ImageCrop and found no issues. I could also test cropping per se now and my test suite is green. So I am now replacing my fork with the upstream again and suspect this issue could be closed, unless the original reporter still sees a problem.
paodb commentedon Oct 8, 2026
Thanks @realulim for the feedback! However, this issue shouldn't be closed yet: the problem still happens in scenarios where the original
Imageis not attached or visible (e.g. when it's only used to build the cropper), both in Vaadin 24.8 and 25. We are going to work on it.As mentioned before by Javier, the idea is:
ImageCrop(DownloadHandler)andsetImageSrc(DownloadHandler), so the resource is registered to theImageCropitself instead of depending on anotherImage.StreamResourceoverloads. SinceStreamResourceis deprecated for removal since Vaadin 24.8, it will likely be deprecated too, mirroringImage.setSrc(AbstractStreamResource).paodb commentedon Oct 9, 2026
A quick update on the plan above: this is being addressed in #37.
DownloadHandleris only available from Vaadin 24.8 on. Version 1.x remains available for earlier Vaadin 24 versions.StreamResourceoverloads won't be added after all.ImageCrop(Image)constructor is removed in 2.0.0. UseImageCrop(String)orImageCrop(DownloadHandler)instead.feat: support DownloadHandler as image source