bugGNU Octave - Bugs: bug #62287, Plotting: printing to pdf raises...

 
 

bug #62287: Plotting: printing to pdf raises error for non-initialized parameter papersize_points

Submitter:  None
Submitted:  Mon 11 Apr 2022 11:46:15 AM UTC
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 7.1.0
Operating System:  * Any
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Sat 30 Apr 2022 03:54:22 PM UTC, comment #4: 

Pushed the changeste here: https://hg.savannah.gnu.org/hgweb/octave/rev/973be5be3327.

Marking as Fixed and closing report.

Rik <rik5>
Project Administrator
Sun 24 Apr 2022 04:14:03 PM UTC, comment #3: 

Hi Rik,

thanks, looks good and works for me! From my side ready to merge :)

Best,
Stefan

Stefan Schlögl <schinzilord>
Sat 23 Apr 2022 02:33:07 AM UTC, comment #2: 

What about the attached changeset which initializes the problem variables when the '-S' switch is used?

(file #53135)

Rik <rik5>
Project Administrator
Mon 11 Apr 2022 12:24:13 PM UTC, comment #1: 

I raised this bug and provided the possible fix. However, upon further testing, I noticed that a forced initialization of the variable papersize_points with running the private function "gs_papersize" would lead to incorrect sizes for ghostscript output files (always some sort of letter format).
So in my opinion either the warning message should be removed or the bugfix should the call to the function like that:
[temp_papersize, papersize_points, paperposition] = ...
                           gs_papersize (arg_st.figure, arg_st.orientation)

(instead of overwriting the arg_st structure with incorrect information just read in the variables which are really required to perform the validation.
Best,
Stefan

Stefan Schlögl <schinzilord>
Mon 11 Apr 2022 11:46:15 AM UTC, original submission:  

This bug exists since 6.3.0 and is persistent also in 7.1.0.

With 6.3.0 release a new warning message was integrated into printing pdfs to file in private function
octave/7.1.0/m/plot/util/private/__print_parse_opts__.m.

The attached example (file test_plot_71.m) yields the following error message:
error: 'papersize_points' undefined near line 502, column 14
error: called from
    _print_parse_opts_ at line 503 column 9
    print at line 420 column 8
    test_plot_71 at line 37 column 1

Papersize_points are only initialized in this private function, if parameter canvas_size is empty. However, if this value is set, the call to set papersize_points never is executed and therefore the intended warning message fails.

Printing png files is possible.

Since this warning messages was not there in releases prior to 6.3.0, I guess there are two ways to fix the issue:
1) remove warning message and related if condition in line 498
2) initialize papersize_points correctly. For this solution I have attached the changes (File bug_papersize.patch) in order to keep the warning.

However, overall it is unclear to me how this variable is used at all besides issueing a warning. Papersize_position is not part of the returned structure arg_st.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #53135:  bug62287.cset added by rik5 (1KiB - application/octet-stream)
file #53071:  test_plot_71.m added by None (1KiB - text/x-objcsrc)
file #53072:  bug_papersize.patch added by None (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by schinzilord (Posted a comment)
  •  

    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 project members can vote.

     

     

     

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-04-30 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2022-04-23 rik5 Attached File- Added bug62287.cset, #53135
        StatusNone Patch Submitted
        Release6.3.0 7.1.0
    2022-04-11 None Attached File- Added test_plot_71.m, #53071
        Attached File- Added bug_papersize.patch, #53072

    Back to the top


    Powered by Savane 3.9