bugGNU Octave - Bugs: bug #37753, print image-plot to svg not working

 
 

bug #37753: print image-plot to svg not working

Submitter:  Muhali <muhali>
Submitted:  Thu 15 Nov 2012 06:58:57 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  1 - Later Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 19 Oct 2015 10:26:48 PM UTC, comment #6: 

Thanks Avinoam for confirming it works.
Closing report.

Pantxo Diribarne <pantxo>
Group Member
Mon 19 Oct 2015 09:01:25 PM UTC, comment #5: 

Attached foo.svg, result of


image(x=1:2, y=1:2, x'*y);
print foo.svg


from comment #1, run with MXE-Octave, compiled with gl2ps ver. 1.3.9.
(with ver 1.3.8 it was empty figure file...)

(file #35232)

Avinoam Kalma <avinoam>
Group Member
Sat 17 Oct 2015 05:14:32 PM UTC, comment #4: 

gl2ps has been patched and the current development version produces properly scaled images. AFAIU there will be a a release of gl2ps soon [1].

I think we can close this report as it has been fixed upstream

[1] http://www.geuz.org/pipermail/gl2ps/2015/000421.html

Pantxo Diribarne <pantxo>
Group Member
Mon 28 Apr 2014 02:53:22 AM UTC, comment #3: 

I've done some more testing and I'm pretty certain this is a problem with gl2ps rather than Octave.  Until they do something about this images just aren't going to output well to svg.

Rik <rik5>
Group administrator
Thu 28 Feb 2013 01:48:46 AM UTC, comment #2: 

Alas, I'm not certain this isn't an Octave bug with the printing of 'image' data to svg.  I used rectangle() to create 4 differently-colored boxes on an ordinary plot background.  When I print this the svg is correct.  I'm attaching that file as svg_rect_tst.m

Secondly, the white polygons are present at the beginning of every svg file.  They represent the axis background.  You can verify this with


set (gca, "color", [0.5 0.5 0.5]);
print foo.svg


Now I get the following in the svg file.


<polygon fill="#7f7f7f" points="521.28,384.48 521.28,32.4 521.28,384.48"/>
<polygon fill="#7f7f7f" points="521.28,32.4 521.28,32.4 521.28,384.48"/>
<polygon fill="#7f7f7f" points="74.88,32.4 521.28,32.4 74.88,32.4"/>
<polygon fill="#7f7f7f" points="521.28,32.4 521.28,32.4 74.88,32.4"/>
<polygon fill="#7f7f7f" points="74.88,384.48 521.28,384.48 74.88,32.4"/>
<polygon fill="#7f7f7f" points="521.28,384.48 521.28,32.4 74.88,32.4"/>




(file #27540)

Rik <rik5>
Group administrator
Sun 18 Nov 2012 02:22:12 AM UTC, comment #1: 

I looked at the content of the svg-file, and found that the four rectangles are being drawn as white.


<polygon fill="#ffffff" points="521.28,384.48 521.28,384.48 521.28,32.4"/>
<polygon fill="#ffffff" points="521.28,384.48 521.28,32.4 521.28,32.4"/>
<polygon fill="#ffffff" points="74.88,32.4 74.88,32.4 521.28,32.4"/>
<polygon fill="#ffffff" points="74.88,32.4 521.28,32.4 521.28,32.4"/>
<polygon fill="#ffffff" points="74.88,32.4 74.88,384.48 521.28,384.48"/>
<polygon fill="#ffffff" points="74.88,32.4 521.28,384.48 521.28,32.4"/>


This appears to be a bug or missing feature in gl2ps.  The files where the bug is likely to be found are libinterp/interp-core/gl2ps.c and/or libinterp/interp-core/gl2ps.h.  When I have time, I hope to take a look.  In the event someeone gets to this before me, the bug is found the change should be made upstream at the link below.

http://geuz.org/gl2ps/


Ben Abbott <bpabbott>
Group Member
Thu 15 Nov 2012 06:58:57 PM UTC, original submission:  


image(x=1:2, y=1:2, x'*y);
print foo.svg


produces incorrect output (basically an empty figure).

Muhali <muhali>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #35232:  foo.svg added by avinoam (5KiB - image/svg+xml)
file #27540:  svg_rect_tst.m added by rik5 (268B - text/x-octave)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Updated the item)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by muhali (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-10-19 pantxo Open/ClosedOpen Closed
    2015-10-19 avinoam Attached File- Added foo.svg, #35232
    2015-10-17 pantxo StatusNone Fixed
    2014-04-28 rik5 Priority5 - Normal 1 - Later
    2013-02-28 rik5 Attached File- Added svg_rect_tst.m, #27540

    Back to the top

    Powered by Savane 3.14-8aba.
    Corresponding source code