Community
Participate
Working Groups
Build Identifier: 20110505-1223 The export function of Graphity shinks large figures to 3000px*3000px. This becomes a problem in case of larger diagrams. In our use cases, diagrams comprise around 10000px (height) * 5000px (width). Reproducible: Always Steps to Reproduce: 1. Open a Graphity diagram 2. Right click on the diagram and select "Export Diagram" in the context menue 3. Enter a Width/Heiht > 3000 px
Would like to target for Juno, check if downport to Indigo SR1 is possible
The upper bound of 3000 is hardcoded in AbstractFigureSelectionDialog. If one relaxes this condition we get no more handles error, at least on windows. TODO: try on OS X. A related forum entry can be found here: http://www.eclipse.org/forums/index.php/m/647019/
(In reply to comment #2) > The upper bound of 3000 is hardcoded in AbstractFigureSelectionDialog. > If one relaxes this condition we get no more handles error, at least on > windows. I tried and played around with these limits and found they could be (slightly) increased at least on a Windows 64 Bit VM. But due to lack of time I was not able to identify the concrete limit (but definitly below the 10000x5000 requested).
Yes, it is not a tight bound. But i think we should not raise the bar too much, since we do not know what happens on other OS/hardware. Probably we should find a completely different way for export or the user who wants large versions of his diagrams could use svg export which allows smooth scaling after exporting!
It's not a Windows specific problem. It also occurs on OS X. The problem is the available memory. For the temp image model and the export step we need a lot of memory. Despite the fact that the heapsize is big enough, some SWT APIs have problems with larger images. Normally Graphiti exports the diagram with the following steps: Image image = new Image(display, width, heigth); // ... paint figures from GEF diagram in image ImageData imageData = image.getImageData(); ImageLoader loader = new ImageLoader(); loader.data = new ImageData[] { imageData }; loader.save("c:/temp/newImage.png", SWT.IMAGE_PNG); // or BMP, GIF, JPEG,... I've found the following problems: * Image.getImageData() doesn't work for large images > 5000x5000. I don't know the exact limit. It depends on the heapsize, eclipse runtime or standalone app, debug mode or not, ... * If Image.getImageData() works fine it could be possible that the remaining memory on the heap is not enough for ImageLoader.save() - especially for the export of type bmp, which needs a huge amount of memory. * The graphiti save is also not effective enough. There are unnecessary temp variables which waste memory. I've opened a SWT bugzilla for Image.getImageData(): https://bugs.eclipse.org/bugs/show_bug.cgi?id=356571 Planned solution if we get a fix for Image.getImageData(): We can allow an max image size of 5K*10K px. That needs ~381 MB of memory for the image model. There should be enough memory for ImageLoader.save(). For such large diagrams the heap size must be set at least to 768MB. As export type we can only allow SWT.IMAGE_PNG. For the other formats ImageLoader.save() needs to much memory or produces other problems (we must test the different formats after the fix is available) The Graphiti save process must be refactored, so that we allocate so less memory as possible. TODO: Check behaviour on 64bit system.
I've added PNG as new export format. With this new format the max export size can be 10k x 10k px. It seems that the underlying SWT export works fine for large diagrams in this format. For the other formats ImageLoader.save() needs to much memory or produces other problems. Therefore it is not planned to support the export with larger diagrams in these formats. If you are facing some problems with the export of larger diagrams in format PNG please try to start your app with a larger heap size. commit 3a9be986d1526339eb7846552a54dd05182a9e1e Author: mgorning <matthias.gorning@sap.com> 2012-02-22 08:25:27 Committer: mgorning <matthias.gorning@sap.com> 2012-02-22 08:26:49 Parent: 8847717de7745b88399d04189c4f7b61e03dd76a (formatter) Branches: origin/master, master
You need at least this SWT version: swt-3.8M5
I have tested with Eclipse(32) and Eclipse(64) and it works.
Bookkeeping: Set target release
Part of Graphiti 0.9.0 (Eclipse Juno)