So in CUBA, the way image previewing/etc was done (from Loading and Displaying Images - CUBA Platform. Developer’s Manual - down near the bottom), used image.setSource(FileDescriptorResource.class).setFileDescriptor(fileDescriptor) - however… in Jmix, there is no FileDescriptorResource and like so many other things, there’s no mention of this in the migration docs.
We have not yet started our migration of the Cuba - Jmix application and I do not have at hand a sample project c addon migration to check…
But I planned for us use load fileDescriptor → byte[] and then:
image.setSource(StreamResource.class)
.setStreamSupplier(() -> new ByteArrayInputStream(...))
Hmmm, @andrey_vb - I’m not seeing a way to convert a FileDescriptor to a byte[]! The only interesting method on FileDescriptor is getName() and that only returns the bare filename. There is no getBytes() or similar. O_o