bugGNU Octave - Bugs: bug #35307, printed bitmaps are the wrong size

 
 

bug #35307: printed bitmaps are the wrong size

Submitter:  Ben Abbott <bpabbott>
Submitted:  Sat 14 Jan 2012 02:01:09 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Fixed Assigned to:  bpabbott
Originator Name:  Ben Abbott Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 27 Jun 2013 04:08:24 AM UTC, comment #5: 

Hi. The bug is back.

'-S1281,802' gives an image of 1279x800, '-S1282,802' gives an image of 1281x800. I can't get an image of the desired size, 1280x800.

The code from the original submission of this bug gives an image of 1023x767.

Octave 3.6.4, x86_64

Tor Bellino <torbellino>
Tue 17 Jan 2012 12:26:45 PM UTC, comment #4: 

I've pushed a changeset to the default branch.

http://hg.savannah.gnu.org/hgweb/octave/rev/df695e37d404

I'm closing this report.

Ben Abbott <bpabbott>
Group Member
Sun 15 Jan 2012 11:35:14 PM UTC, comment #3: 

I've attached a first attempt at a changeset. This one fixes the gnuplot backend for me.

On MacOS, fltk-aqua behaves strangely so I'm  not getting the correct figure height. Below is a test script that produces a png file with 1023x767 pixels.


figure (1)
clf
plot (rand (3))
print test_1024x768.png '-S1024,768'


With the attached changeset, and using the gnuplot backend, I get the correct size (1024x768). With the fltk backend I get 1024x770. I thought I had reported this bug, but don't see it at the moment in the tracker (I'll need to look more carefully).

(file #24831)

Ben Abbott <bpabbott>
Group Member
Sat 14 Jan 2012 03:19:15 PM UTC, comment #2: 

The basic problem is that there is no HiResBoundingBox specified in the eps output.

Thus we'll need to make sure that 1pt is an integer number of pixels

Ben Abbott <bpabbott>
Group Member
Sat 14 Jan 2012 02:39:10 PM UTC, comment #1: 

The problem is that ghostscript is rounding the bbox off in points. When converted to pixels the result can be off +/- (resolution/72).

This can be fixed setting the resolution to 72 and scaling the fontsize by the proper amount.

I'll prepare a changeset and compare with ML's behavior.

Ben Abbott <bpabbott>
Group Member
Sat 14 Jan 2012 02:01:09 PM UTC, original submission:  

The short script below produces a figure size of 1023x767


clf
plot (rand (3))
print test.png  '-S1024,768'


Ben Abbott <bpabbott>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #24831:  changeset.patch added by bpabbott (3KiB - application/octet-stream - first attempt)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by torbellino (Posted a comment)
  • -email is unavailable- added by bpabbott (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-01-17 bpabbott StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2012-01-15 bpabbott Attached File- Added changeset.patch, #24831
        StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code