GNOME Bugzilla – Bug 470926
cairo export to png displaces imported images
Last modified: 2007-09-15 20:00:52 UTC
Please describe the problem: When I export my diagrams in dia to png the location (x,y) of my custom icons/images is displaced from what it was in the original diagram. There seems to be a trend in how much the images are displaced relative to each other; a visible pattern that is. This problem does not seem to arise when exporting to JPEG, but I use PNG for preservation of image quality/size. Steps to reproduce: 1. Create a new dia document 2. Import a picture or two (mine were small png icons/images) 3. Save as a png format picture Actual results: When exported to <filename>.png any icons that were imported images should be displaced. Mine were displaced to the right. Expected results: When exported to <filename>.png any icons that were imported images should be displaced. Mine were displaced to the right. I created a new file and came up with the same results. Does this happen every time? Yes Other information: This only seems to happen with images I import to use with my diagram. I've mainly used this on Windows, but tried it on Linux - same result with the 0.96.1 version. On Windows the 0.95.x version I have does not displace the images I've imported to the file I'm exporting. Please contact me for an example both a .dia file and my exported .png file. Thanks, I hope this is resolved before I need to turn in my project! Nah I'll just export to something else - thanks again.
There are many ways to export PNG from Dia: "Cairo PNG", "Pixbuf[png]", "PNG (anti-aliased)". Please choose one explicit under Export options and tell us which one creates the displacement. The ones I tried seem to work correctly. Attaching a sample diagram could additionally help to reproduce.
Created attachment 95313 [details] PNG Displacement info for Bug 470926 PNG Displacement info for Bug 470926
Thanks for the information. To make it more accessible I've pasted your text below. BTW: the cairo plug-ins is marked experimental - at least in the Linux build and it has the descibed bug. You can switch it off by File/Plugins..:"Cairo" - unckeck "Load at Startup" [from the attachement] If you take a look at the cairo PNG types, you can see they displace my inserted images; not to mention cairo w/ alpha is really pixelated or whatever. Now normally I just tack on the .png extension when Exporting my files. Obviously, dia defaults to using the cairo png file format (which ever one of them). That could be my problem, but what made the difference? I do have version 0.95.x instead on another computer and it does not have the displacment problem. It is ever so nice to be able to type my own file extension manually and save it quick. I did a test with "By Extension" selected too. To my eye it looks like choosing "By Extension" makes it cairo png and not regular "Portable Network Graphics". Please help and thanks for the great application. Most likely you will need to re-import my images that are within the *.dia file b/c it looks for that specific directory when loading the file after creation. Sorry, but that's the way it is. ### I have included the following files: ###
I would just like to note that I tried it both on Linux and Windows, but when I first had the problem it was when using Windows. Thank you very much, for my installs of dia, I will just turn off Cairo Plugins so I don't accidentally get it saved in those image formats. That works for me. Keep up the good work and thanks for the prompt responses.
2007-09-15 Hans Breuer <hans@breuer.org> * plug-ins/cairo/diacairo.c : don't position the image twice, cairo_set_source_surface() does get 0,0 offset. Fixes bug #470926