Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 61922 - media-gfx/jpeg2ps-1.9 uses hardcoded default paper size
Summary: media-gfx/jpeg2ps-1.9 uses hardcoded default paper size
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Nguyen Thai Ngoc Duy (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-27 07:00 UTC by Ulrich Müller
Modified: 2008-05-03 15:59 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed patch for jpeg2ps-1.9.ebuild (patch,1.22 KB, patch)
2005-07-29 02:21 UTC, Ulrich Müller
Details | Diff
Proposed patch for jpeg2ps-1.9-r1.ebuild (patch,355 bytes, patch)
2005-08-31 01:23 UTC, Ulrich Müller
Details | Diff
Proposed patch for jpeg2ps-1.9-r1.ebuild (jpeg2ps-1.9-r1.ebuild.diff,806 bytes, patch)
2008-04-11 06:44 UTC, Ulrich Müller
Details | Diff
jpeg2ps-1.9-libpaper.patch (jpeg2ps-1.9-libpaper.patch,3.38 KB, patch)
2008-04-17 08:01 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2004-08-27 07:00:12 UTC
The ebuild uses "letter" as hardcoded default paper size. This should be configurable.

Suggestion: Use /etc/localtime to determine the continent, as in net-misc/hylafax-4.2.0_rc2. Or introduce a useflag.

(See also bugs #34741, #38465, and #52716. Maybe it is time for a general solution for this issue.)
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-07-27 18:18:39 UTC
Re-assign a stale bug.
Comment 2 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2005-07-28 23:14:01 UTC
It's not the ebuild hardcode this but the program jpeg2ps itself. As the ebuild
says, you may you -p to specify other paper size. I mark this as WONTFIX. Please
request to upstream.
Comment 3 Ulrich Müller gentoo-dev 2005-07-29 02:18:10 UTC
It is more complicated. The Makefile from the source tar defaults to A4
paper format ("-DA4" compile time option). The ebuild meddles with this,
effectively changing the default to Letter.

Now, I completely disagree about this being an upstream issue. What should
upstream do about this? They already provide a compile time and a run time
option.

Upstream knows nothing about the environment where the program will be installed.
IMHO, it is the responsibility of the distribution to get things right.
Comment 4 Ulrich Müller gentoo-dev 2005-07-29 02:21:27 UTC
Created attachment 64597 [details, diff]
Proposed patch for jpeg2ps-1.9.ebuild

Determines the default pagesize depending on the continent.
Comment 5 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2005-07-31 18:32:15 UTC
Ok. I misread the ebuild :(
Applied your patch as jpeg2ps-1.9-r1. Please test it.
Thanks 
Comment 6 Lars Weiler (RETIRED) gentoo-dev 2005-07-31 19:02:28 UTC
I think the timezone is bad to rely on.  Usually you should use LC_PAPER for it
(probably I _want_ to use letter, but I have a European timezone set).

Sorry that I can't send patches yet.  Probably later or you have an idea to ask
for the locale-settings.
Comment 7 Ulrich Müller gentoo-dev 2005-08-01 03:54:28 UTC
In reply to comment #5:

Works fine for me.
Minor issue: pkg_postinst outputs the wrong message; the "local" in the
declaration of pagesize (in src_compile) should be removed. Sorry for that.
Comment 8 Ulrich Müller gentoo-dev 2005-08-31 01:23:34 UTC
Created attachment 67327 [details, diff]
Proposed patch for jpeg2ps-1.9-r1.ebuild

Again: If the remaining minor issue with the postinst message is fixed,
this bug can IMHO be marked as resolved. See attached patch.
Comment 9 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2005-12-02 22:46:08 UTC
Fixed in CVS. I'm really sorry it took too long to solve such a minor issue.
Comment 10 Ulrich Müller gentoo-dev 2008-04-11 06:41:01 UTC
Reopening. The taken solution does not work anymore, since /etc/localtime is no longer a symlink. And meanwhile I think that the default should not depend on the configuration of the installed system.
Comment 11 Ulrich Müller gentoo-dev 2008-04-11 06:44:56 UTC
Created attachment 149370 [details, diff]
Proposed patch for jpeg2ps-1.9-r1.ebuild

Probably a USE flag is the cleanest thing we can do here, see attached patch. 

There is already:

   media-gfx/potrace:metric - default to a4 paper size and metric measurement

So we could go with the "metric" flag, too:

   media-gfx/jpeg2ps:metric - Default to A4 paper size
Comment 12 Ulrich Müller gentoo-dev 2008-04-13 12:54:53 UTC
(In reply to comment #11)
> Created an attachment (id=149370) [edit]
> Proposed patch for jpeg2ps-1.9-r1.ebuild

Committed, as discussed with maekke on irc.
Comment 13 Gerben Vos 2008-04-16 20:39:59 UTC
No; it would be much better if jpeg2ps, potrace and others use libpaper (/etc/papersize) instead. I'll prepare a patch.
Comment 14 Ulrich Müller gentoo-dev 2008-04-17 08:01:35 UTC
Created attachment 150026 [details, diff]
jpeg2ps-1.9-libpaper.patch

(In reply to comment #13)
> No; it would be much better if jpeg2ps, potrace and others use libpaper
> (/etc/papersize) instead.

This looks obvious, and in fact was my first approach, too. I attach my patch for reference (it may still have some rough edges, but basically should work).

However, it would introduce some subtle incompatibilities:
- The "p11x17" page size is not known to libpaper (or rather, it uses a
  different name for it).
- For page sizes other than A4 or Letter, the size of the bounding box may
  differ by 1 or 2 Postscript points.

Therefore, one probably would want another USE flag to enable usage of libpaper. I'm not sure if it's worth the effort.
Comment 15 Ulrich Müller gentoo-dev 2008-05-03 15:59:49 UTC
We might also have a licence problem if we link against libpaper.

From the jpeg2ps licence:
| This software is free. You are granted the right to use and copy it.
| This software may not be sold or bundled with any commercial package
| without express written permission of the author.

And unfortunately, libpaper is not licenced under the LGPL, but under the GPL (version 2 only). I think that this is incompatible with the above (but IANAL).

I've also contacted upstream (Thomas Merz) about this issue. He doesn't want to re-release jpeg2ps under a different licence.