After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 470926 - cairo export to png displaces imported images
cairo export to png displaces imported images
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: exports
0.96.1
Other All
: Normal normal
: 0.97
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2007-08-28 02:25 UTC by Silver Tip
Modified: 2007-09-15 20:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
PNG Displacement info for Bug 470926 (151.63 KB, application/x-compressed-tar)
2007-09-10 22:34 UTC, Silver Tip
Details

Description Silver Tip 2007-08-28 02:25:11 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.
Comment 1 Hans Breuer 2007-09-08 14:54:50 UTC
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.
Comment 2 Silver Tip 2007-09-10 22:34:01 UTC
Created attachment 95313 [details]
PNG Displacement info for Bug 470926

PNG Displacement info for Bug 470926
Comment 3 Hans Breuer 2007-09-11 21:19:47 UTC
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:  ###
Comment 4 Silver Tip 2007-09-12 19:22:05 UTC
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.
Comment 5 Hans Breuer 2007-09-15 20:00:52 UTC
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