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 353681 - Postscript printing work in portrait/portrait mode only, PDF output OK
Postscript printing work in portrait/portrait mode only, PDF output OK
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
2.7.x
Other All
: High major
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks:
 
 
Reported: 2006-08-31 12:45 UTC by Michael Chudobiak
Modified: 2006-10-12 15:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix postscript printing by removing incorrect scaling factors. (1.37 KB, patch)
2006-09-21 12:16 UTC, Michael Chudobiak
none Details | Review

Description Michael Chudobiak 2006-08-31 12:45:40 UTC
Please describe the problem:
Postscript-output printing only works if the gthumb > Print > Paper Details > Orientation (call this setting "A") = Portrait AND the per-printer setup gui has Print > Paper > Page orientation (call this setting "B") = Portrait. 

if A = portrait, B = portrait, output = OK
if A = portrait, B = upside-down portrait, output = blank
if A = landscape, B = landscape, output = blank
if A = landscape, B = upside-down landscape, output = blank

This is true for "Generic Postscript" output (saving to a file, and viewing with Evince), or printing to a (physical) CUPS printer. It is true for images that have X>Y and Y>X.

However, it DOES work in all modes if you use the "Create a PDF document" printer and save to a PDF file (viewed with Evince).

I believe that something is wrong with the postscript bounding box settings.

Steps to reproduce:
1. File > Print
2. Paper Details > Orientation = Landscape
3. Select "Generic Postscript", Location=File, Save As = output.ps
4. Paper > Page orientation = Landscape
5. View output.ps. It is blank.
6. Repeat above, replacing "Landscape" with "Portrait" in steps 2 and 4.
7. View output.ps. It is OK.


Actual results:
See above.

Expected results:
See above.

Does this happen every time?
Yes.

Other information:
Comment 1 Michael Chudobiak 2006-08-31 12:56:01 UTC
I should mention that the default margins and US Letter sizing were used for all tests.
Comment 2 Paolo Bacchilega 2006-08-31 19:51:22 UTC
I cannot reproduce this bug.  Suggestion: instead of using output.ps try to select an output file pressing the "save as" button, it's not clear to me where the output.ps is saved without using "save as".
Comment 3 Michael Chudobiak 2006-08-31 20:48:27 UTC
Well, output.ps goes to your home directory by default. However, using another filename (~/output2.ps) doesn't change the results.

I'm using FC5. Another colleague is having the same problem...

I'll post some sample generated files tomorrow.



Comment 4 Michael Chudobiak 2006-08-31 21:11:49 UTC
Please see http://www.avtechpulse.com/downloads/samples.zip.

One file, portrait-portrait.ps, is an example of a correctly-printed portrait postscript output.

The other file, landscape-landscape.ps, is the same image printed landscape/landscape. It is all blank (viewed with evince), although the file size is approx the same.

- Mike

Comment 5 marty leisner 2006-09-02 16:03:06 UTC
The bounding boxes seem foobar in landscape modes.

In landscape/landscape, the transformation matrix
[621.921 0 0 466.441 85.0394 -4517.22]cm

the -4517 is very strange...

Looking at portrait/portrait, I put in similar numbers into landscape/landscape --
 [621.921 0 0 466.441 85.0394 72.7795]cm
and the image rotated 180 degrees.

I then ran 2.6.x (which was fine) and saw its tranformation matrix:
[0 621.921 -466.441 0 524.82 85.0394]cm
and the image was rotates to lanscape orientation (the paper was portrait,
which seems to make sense).

What's interesting is pdf works, but postscript does not.

Marty

Comment 6 Michael Chudobiak 2006-09-21 12:16:32 UTC
Created attachment 73136 [details] [review]
Patch to fix postscript printing by removing incorrect scaling factors.

This block code appears in two places:

gnome_print_config_set_length (data->pci->config, UCHAR GNOME_PRINT_KEY_PAPER_WIDTH, width, unit);
gnome_print_config_set_length (data->pci->config, UCHAR GNOME_PRINT_KEY_PAPER_HEIGHT, height, unit);
gnome_print_config_set_length (data->pci->config, UCHAR GNOME_PRINT_KEY_LAYOUT_WIDTH, width, unit);
gnome_print_config_set_length (data->pci->config, UCHAR GNOME_PRINT_KEY_LAYOUT_HEIGHT, height, unit);

The "LAYOUT" and "PAPER" width and height are set to the same values. This is wrong. The last two lines should be removed. 

The "LAYOUT" parameters are multiplication (scaling) factors, not absolute measurements. (The "PAPER" parameters are absolute.) In libgnomeprint/data/globals.xml, GNOME_PRINT_KEY_LAYOUT_WIDTH and GNOME_PRINT_KEY_LAYOUT_HEIGHT default to 1.

Patch attached. Please review/commit!
Comment 7 Michael Chudobiak 2006-10-12 15:58:20 UTC
Fixed in CVS head (2.9.0 and later).