Your message dated Sun, 04 Dec 2005 01:45:24 +0900
with message-id <[EMAIL PROTECTED]>
and subject line Bug#341589: choosing img size in html (patch inside)
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 1 Dec 2005 14:56:05 +0000
>From [EMAIL PROTECTED] Thu Dec 01 06:56:05 2005
Return-path: <[EMAIL PROTECTED]>
Received: from adsl-203-134.38-151.net24.it ([151.38.134.203] 
helo=mail.gnudd.com)
        by spohr.debian.org with esmtp (Exim 4.50)
        id 1Ehpqu-0001lO-O4
        for [EMAIL PROTECTED]; Thu, 01 Dec 2005 06:56:05 -0800
Received: from mail.gnudd.com ([EMAIL PROTECTED] [127.0.0.1])
        by mail.gnudd.com (8.13.4/8.13.4/Debian-3) with ESMTP id jB1EtXla003850
        for <[EMAIL PROTECTED]>; Thu, 1 Dec 2005 15:55:33 +0100
Received: (from [EMAIL PROTECTED])
        by mail.gnudd.com (8.13.4/8.13.4/Submit) id jB1EtWQx003849
        for [EMAIL PROTECTED]; Thu, 1 Dec 2005 15:55:32 +0100
Date: Thu, 1 Dec 2005 15:55:32 +0100
From: Alessandro Rubini <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: choosing img size in html (patch inside)
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
X-Face: #Q;A)@_4.#>0+_%y]7aBr:c"ndLp&#+2?]J;lkse\^)[EMAIL 
PROTECTED])J;'nny4%74.fM'n)M
        >ISCj.KmsL/HTxz!:Ju'pnj'Gz&.
Organization: GnuDD, Device Drivers, Embedded Systems, Courses
Sender: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.5 required=4.0 tests=BAYES_00,HAS_PACKAGE,
        HTML_MESSAGE autolearn=no version=2.60-bugs.debian.org_2005_01_02


Package: mgp
Version: 1.11b-2
Severity: wishlist

What I need is being able to choose the image size for html dumps.
The patch included implements this feature for mgp-1.11b, and is just
a port of bug 161055, I sent three years ago.  I submit a new bug
report so the html page gets updated. I'll try to close the previous bug
myself.

I'm resubmitting the previous description of the patch here:

The problems:
        A) I do my presentations at 1024x768, but a lot of people run
        at 1024 themselves, so using a browser the page is slightly too large.
        B) The index page is good for following the presentation if images
        are not too reduced.

The solution:
        Reduction in image size is now configurable, the default being
        a reduction of 1.0 and 0.25 like it was in the original.

The details:
        - added two double variables preset to 1.0 and 0.25
        - added "-s" command line option to change them
        - added help message for "-s"
        - removed WIDTH and HEIGHT html attributes, not needed and now not
                deterministic any more
        - generate idx from xwintoppm (not from previous output) since the
                size of idx is absolute instead of relative (e.g., I use
                0.8,0.5, where 0.5 should not be half of 0.8 but rather
                half of original image. Besides this makes the idx image better
                in case of lossy compression (jpg).

Additionally (though unrelated)
        - added a "jpeg" type identical to "jpg" for people mistyping it.

Related suggestions:
        * Since png is much better than jpg for synthetic images, I
        think it should be the default.
        * if the patch is accepted, the decompression programs are not needed
        any more in convtab[]
        * probably pnmtojpeg should be preferred to cjpeg





--- ./mgp.c.orig        2005-12-01 15:05:03.000000000 +0100
+++ ./mgp.c     2005-12-01 15:42:17.000000000 +0100
@@ -87,6 +87,9 @@
 static char *tsfile = NULL;
 static char *dumpdir = NULL;
 
+static double imgreduce_page = 1.0;   /* image for html pages is not reduced */
+static double imgreduce_index = 0.25; /* image for index.html is reduced by 4 
*/
+
 char *gsdevice = DEFAULT_GSDEV;
 char *htmlimage;
 
@@ -255,7 +258,7 @@
        argv=tmp_argv;
        argc=tmp_argc;
 
-#define ACCEPTOPTS     "Bd:vVob:c:eg:f:hlGp:qt:Q:PSUT:D:CORw:X:x:nF:E:"
+#define ACCEPTOPTS     "Bd:vVob:c:eg:f:hlGp:qt:Q:PSUT:D:CORw:X:x:nF:E:s:"
        while ((opt = getopt(argc, argv, ACCEPTOPTS)) != -1) {
 #undef ACCEPTOPTS
                switch (opt) {
@@ -410,6 +413,15 @@
                        htmlimage = optarg;
                        break;
 
+               case 's':
+                       if (sscanf(optarg, "%lf,%lf", &imgreduce_page,
+                                       &imgreduce_index) != 2) {
+                               fprintf(stderr, "%s: wrong sizes \"%s\"\n",
+                                       argv[0], optarg);
+                               exit(1);
+                       }
+                       break;
+
                case 'h':
                default:
                        mgp_usage(progname);
@@ -493,6 +505,7 @@
        int page;
        char *childdebug;
        char *convdb[][3] = {{ "jpg", "cjpeg", "djpeg" },
+                               { "jpeg", "cjpeg", "djpeg" },
                                { "png", "pnmtopng", "pngtopnm" },
                                { NULL, NULL, NULL }};
        int inum = 0;
@@ -543,17 +556,16 @@
                 */
                fprintf(stderr, "(full image)");
                sprintf(buf, "xwintoppm -silent -name MagicPoint | "
-                       "%s %s > %s/mgp%05d.%s",
+                       "pnmscale %f | %s %s > %s/mgp%05d.%s", imgreduce_page,
                        convdb[inum][1], childdebug, dumpdir, page, EXT);
                if (system(buf) < 0){   /*XXX security hole*/
                        fprintf(stderr, "system() failed for %s", buf);
                        exit(-1);
                }
                fprintf(stderr, "(thumbnail)");
-               sprintf(buf, "%s %s/mgp%05d.%s | "
-                       "pnmscale 0.25 | %s %s > %s/mgp%05d.idx.%s",
-                       convdb[inum][2], dumpdir, page, EXT, convdb[inum][1], 
childdebug,
-                       dumpdir, page, EXT);
+               sprintf(buf, "xwintoppm -silent -name MagicPoint | "
+                       "pnmscale %f | %s %s > %s/mgp%05d.idx.%s", 
imgreduce_index,
+                       convdb[inum][1], childdebug, dumpdir, page, EXT);
                if (system(buf) < 0){   /*XXX security hole*/
                        fprintf(stderr, "system() failed for %s", buf);
                        exit(-1);
@@ -596,8 +608,8 @@
                                page, EXT, page);
                } else {
                        fprintf(html, "<IMG SRC=\"mgp%05d.%s\" "
-                               "WIDTH=%d HEIGHT=%d ALT=\"Page %d\"><BR>\n",
-                               page, EXT, window_width, window_height,
+                               "ALT=\"Page %d\"><BR>\n",
+                               page, EXT,
                                page);
                }
                fprintf(html, "<HR>Generated by "
@@ -662,10 +674,8 @@
                } else {
                        fprintf(html, "<A HREF=\"mgp%05d.html\">"
                                "<IMG SRC=\"mgp%05d.idx.%s\" "
-                               "WIDTH=%d HEIGHT=%d "
                                "ALT=\"Page %d\"></A>\n",
-                               page, page, EXT, window_width / 4,
-                               window_height / 4, page);
+                               page, page, EXT, page);
                }
        }
        fprintf(html, "<HR>\n");
@@ -713,6 +723,7 @@
        fprintf(stderr, "\t-o: Do not override the window manager\n");
        fprintf(stderr, "\t-p <page>: Start at the specified page\n");
        fprintf(stderr, "\t-q Do not beep on errors\n");
+       fprintf(stderr, "\t-s <page>,<index>: Size reduction for html images 
(default 1.0,0.25)\n");
        fprintf(stderr, "\t-t <timeslot>: Enable presentation timer\n");
        fprintf(stderr, "\t-v: Show version number and quit\n");
        fprintf(stderr, "\t-w <dir>: Specify a working directory\n");

---------------------------------------
Received: (at 341589-done) by bugs.debian.org; 3 Dec 2005 16:45:26 +0000
>From [EMAIL PROTECTED] Sat Dec 03 08:45:26 2005
Return-path: <[EMAIL PROTECTED]>
Received: from etrange.ukai.jp ([218.223.29.42])
        by spohr.debian.org with esmtp (Exim 4.50)
        id 1EiaVq-0005Rf-L9
        for [EMAIL PROTECTED]; Sat, 03 Dec 2005 08:45:26 -0800
Received: from localhost.localdomain (etrange [127.0.0.1])
        by etrange.ukai.jp (Postfix) with ESMTP id 5079234346
        for <[EMAIL PROTECTED]>; Sun,  4 Dec 2005 01:45:24 +0900 (JST)
Received: from localhost.localdomain.ukai.org (localhost [127.0.0.1])
        by localhost.localdomain (Postfix) with ESMTP id 41E24F040C
        for <[EMAIL PROTECTED]>; Sun,  4 Dec 2005 01:45:24 +0900 (JST)
Date: Sun, 04 Dec 2005 01:45:24 +0900
Message-ID: <[EMAIL PROTECTED]>
From: Fumitoshi UKAI <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: Bug#341589: choosing img size in html (patch inside)
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 
(Marutamachi) APEL/10.6 Emacs/21.4 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)
Organization: Debian JP Project
MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")
Content-Type: text/plain; charset=US-ASCII
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02

At Thu, 1 Dec 2005 15:55:32 +0100,
Alessandro Rubini wrote:

> What I need is being able to choose the image size for html dumps.
> The patch included implements this feature for mgp-1.11b, and is just
> a port of bug 161055, I sent three years ago.  I submit a new bug
> report so the html page gets updated. I'll try to close the previous bug
> myself.
> 
> I'm resubmitting the previous description of the patch here:
> 
> The problems:
>       A) I do my presentations at 1024x768, but a lot of people run
>       at 1024 themselves, so using a browser the page is slightly too large.
>       B) The index page is good for following the presentation if images
>       are not too reduced.

Well, what wrong with -g option with -D option?

Regards,
Fumitoshi UKAI


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to