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 348780 - Images used as background in graphs are not serialized
Images used as background in graphs are not serialized
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: Graphing / Charting
unspecified
Other Linux
: High enhancement
: ---
Assigned To: Jean Bréfort
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2006-07-26 13:20 UTC by sum1
Modified: 2008-08-03 10:13 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
proposed patch (9.78 KB, patch)
2006-08-11 12:58 UTC, Jean Bréfort
none Details | Review
commited patch (4.77 KB, patch)
2006-08-18 07:52 UTC, Jean Bréfort
committed Details | Review
makes things mostly work (12.25 KB, patch)
2008-07-12 07:51 UTC, Jean Bréfort
none Details | Review
gnumeric side patch (2.49 KB, patch)
2008-07-14 19:46 UTC, Jean Bréfort
none Details | Review
the good one, I hope (15.87 KB, patch)
2008-07-14 19:48 UTC, Jean Bréfort
none Details | Review
last patch (16.45 KB, patch)
2008-08-03 09:30 UTC, Jean Bréfort
committed Details | Review
the associated gnumeric patch (3.28 KB, patch)
2008-08-03 09:31 UTC, Jean Bréfort
committed Details | Review

Description sum1 2006-07-26 13:20:38 UTC
This bug is reproducible with libgoffice CVS-HEAD and AbiWord CVS-HEAD on FC5. The same steps work fine with AbiWord 2.4.5, though.

Steps to reproduce:
- Load http://www.abisource.com/~uwog/abiword-testsuite/impexp/abw/simple-chart.abw
- Right-click on the chart and select 'Format Object'
- With 'Graph' selected choose 'Image' from the Fill combo
- Press the Select button and choose an image (e.g. /usr/share/pixmaps/bug-buddy.png)
- Press Apply


Backtrace:

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 1912)

  • #0 go_image_get_pixbuf
    at go-image.c line 566
  • #1 gog_renderer_pixbuf_draw_polygon
    at gog-renderer-pixbuf.c line 441
  • #2 gog_renderer_draw_sharp_polygon
    at gog-renderer.c line 529
  • #3 draw_rectangle
    at gog-renderer.c line 780
  • #4 gog_outlined_view_render
    at gog-outlined-object.c line 151
  • #5 gog_graph_view_render
    at gog-graph.c line 668
  • #6 gog_view_render
    at gog-view.c line 775
  • #7 gog_renderer_pixbuf_update
    at gog-renderer-pixbuf.c line 1148
  • #8 GOChartView::render
    at AbiGOChart.cpp line 720
  • #9 GR_GOChartManager::render
    at AbiGOChart.cpp line 629
  • #10 fp_EmbedRun::_draw
    at fp_EmbedRun.cpp line 441
  • #11 fp_Run::draw
    at fp_Run.cpp line 1213
  • #12 fp_Line::draw
    at fp_Line.cpp line 1605
  • #13 fp_VerticalContainer::draw
    at fp_Column.cpp line 1124
  • #14 fp_Page::draw
    at fp_Page.cpp line 1000
  • #15 FV_View::_draw
    at fv_View_protected.cpp line 4392
  • #16 FV_View::updateScreen
    at fv_View.cpp line 7827
  • #17 fl_DocListener::signal
    at fl_DocListener.cpp line 2343
  • #18 PD_Document::signalListeners
    at pd_Document.cpp line 2879
  • #19 FV_View::_generalUpdate
    at fv_View_protected.cpp line 3224
  • #20 FV_View::cmdUpdateEmbed
    at fv_View_cmd.cpp line 5499
  • #21 cb_update_graph
    at AbiGOChart.cpp line 321

Comment 1 Jean Bréfort 2006-07-27 21:01:16 UTC
I'm quite surprised that it works fine with abiword-2.4.5 since we never wrote the code to save the image with the style. I suspect you just mean it does not crash, but the image should not be there in abiword.
I can't reproduce the bug at the moment, but I did not update recently...
I'll have a closer look ASAP.
Comment 2 Jean Bréfort 2006-07-27 21:18:43 UTC
OK, I can now reproduce.
Comment 3 sum1 2006-07-27 21:42:24 UTC
(In reply to comment #1)
> I'm quite surprised that it works fine with abiword-2.4.5 since we never wrote
> the code to save the image with the style. I suspect you just mean it does not
> crash, but the image should not be there in abiword.

Indeed, I meant it didn't crash. Sorry for the confusion.
Comment 4 Jean Bréfort 2006-08-11 12:58:38 UTC
Created attachment 70712 [details] [review]
proposed patch

fixing the crash is straightforward. We just need to test if the GImage* arg is NULL in go_image_get_pixbuf. But this patch also adds support to serialization of the image.
I don't know if it is a good idea to split the code between go-image.c and gog-style.c, so this patch needs some review. Jody, your opinion?
I did not test the sax importer.
Comment 5 Jody Goldberg 2006-08-16 23:14:58 UTC
Now that we have GODoc I think it's time to solve this properly.  To date we have never had an object to manage GOImages.  We should really be able to store a set of images as named objects at the document level.  Then refer to those images in the styles and other sources by name.  That will let us solve the issues with inline and reference images.

At a minimum get the crash test, and the style property segments into cvs.
Then we can discuss how to store the image itself in the document, and how to reference that elsewhere.
Comment 6 Jean Bréfort 2006-08-18 07:52:31 UTC
Created attachment 71128 [details] [review]
commited patch

At least, abiword should not crash anymore.
Using GODoc to save the pixels seems a great idea, but we must be careful to not break anything.
Comment 7 Jean Bréfort 2006-08-18 08:53:25 UTC
renaming and changing the severity since the crash is fixed.
Comment 8 Jody Goldberg 2007-07-02 01:06:53 UTC
Unfortunately pushed off into 0.5.x
But I'd like to see this tackled early
Comment 9 Jean Bréfort 2007-07-07 05:40:54 UTC
The main issue to solve is having GODoc manage the images. This is all but trivial IMHO.
Comment 10 Jean Bréfort 2008-06-22 07:09:03 UTC
Images pushed to GODoc (in trunk), but still not serialized.
Comment 11 Jean Bréfort 2008-07-12 07:51:57 UTC
Created attachment 114426 [details] [review]
makes things mostly work

Jody, I know you don't like the GOImage::saved hack, but it is the simplest solution. Another way would be to save all images at the end of the document.
Copying to another workbook in the same process works, but not yet inter-process which uses the (not yet implemented) DOM model for loading the data.
Comment 12 Jean Bréfort 2008-07-14 19:46:38 UTC
Created attachment 114541 [details] [review]
gnumeric side patch
Comment 13 Jean Bréfort 2008-07-14 19:48:48 UTC
Created attachment 114542 [details] [review]
the good one, I hope

Jody, please review, and specially have a look at the comment in go-doc.c, function load_image_data.
When pasting use SAX, images will also survive inter process copying.
Comment 14 Jean Bréfort 2008-08-03 09:30:29 UTC
Created attachment 115770 [details] [review]
last patch
Comment 15 Jean Bréfort 2008-08-03 09:31:21 UTC
Created attachment 115771 [details] [review]
the associated gnumeric patch
Comment 16 Jean Bréfort 2008-08-03 10:12:58 UTC
Fixed, although in some cases we might end with two or more instances of the same images in memory (inter-process clipboard operations with identical images in the two documents), IMHO a very minor issue.