Article 5946 of alt.sources:
Path: jac.zko.dec.com!crl.dec.com!crl.dec.com!bloom-beacon.mit.edu!uhog.mit.edu!sgiblab!rahul.net!a2i!flash.us.com!flash.us.com!not-for-mail
From: dclunie@flash.us.com
Newsgroups: alt.sources
Subject: PATCH: XV-3.10+magicpic2pcd reads PhotoCD
Followup-To: alt.graphics.pixutils
Date: 16 Jun 1995 01:25:18 +0300
Organization: Her Master's Voice
Lines: 657
Message-ID: <3rqc0e$afh@flash.ksapax>
Reply-To: dclunie@flash.us.com
NNTP-Posting-Host: flash.ksapax

Patch-name: xv-3.10-magpic2pcd.patchnew

Patch to xv-3.10 to allow PhotoCD images to be imported.

Released 15 Jun 1995, dclunie@flash.us.com.

This patch applies to versions of xv-3.10 that have already been
patched with the magic pic patch from Japan that is called
Patch.magpic2.PhotoCD.XV310a. It adds additional facilites.

DO NOT apply this patch until after Patch.magpic2.PhotoCD.XV310a.

Replaces earlier similar patches including:

	- xv-3.00-pcd.patch
	- xv-3.00-pcd.patchnew
	- xv-3.10a-pcd.patch

If you do not have Patch.magpic2.PhotoCD.XV310a, or do not want to
apply it, then there is an accompanying patch, xv-3.10-pcd.patchnew,
that can be applied to the original xv-3.10 distribution.

To apply this patch:

	% cd xv-3.10magpic2pcd
	% patch -p1 <../xv-3.10-magpic2pcd.patchnew


diff -c -r xv-3.10magpic2pcd/Makefile xv-3.10magpic2pcdnew/Makefile
*** xv-3.10magpic2pcd/Makefile	Thu Jun 15 21:50:12 1995
--- xv-3.10magpic2pcdnew/Makefile	Thu Jun 15 22:00:43 1995
***************
*** 30,37 ****
  ### Installation locations
  BINDIR = /usr/local/bin
  MANDIR = /usr/local/man/man1
! MANSUF = 1
  LIBDIR = /usr/local/lib
  
  
  buildit: all
--- 30,42 ----
  ### Installation locations
  BINDIR = /usr/local/bin
  MANDIR = /usr/local/man/man1
! MANSUFFIX = 1
  LIBDIR = /usr/local/lib
+ INSTALL = install
+ INSTPGMFLAGS = -s
+ INSTBINFLAGS = -m 0755
+ INSTLIBFLAGS = -m 0644
+ INSTMANFLAGS = -m 0444
  
  
  buildit: all
***************
*** 189,195 ****
  	xvdial.o xvgraf.o xvsunras.o xvjpeg.o xvps.o xvpopup.o xvdflt.o \
  	xvtiff.o xvtiffwr.o xvpds.o xvrle.o xviris.o xvgrab.o vprintf.o \
  	xvbrowse.o xvtext.o xvpcx.o xviff.o xvtarga.o xvxpm.o xvcut.o \
! 	xvxwd.o xvfits.o xvmag.o xvmaki.o xvpic.o xvpi.o xvpic2.o xcpcd.o
  
  MISC = README INSTALL CHANGELOG IDEAS
  
--- 194,200 ----
  	xvdial.o xvgraf.o xvsunras.o xvjpeg.o xvps.o xvpopup.o xvdflt.o \
  	xvtiff.o xvtiffwr.o xvpds.o xvrle.o xviris.o xvgrab.o vprintf.o \
  	xvbrowse.o xvtext.o xvpcx.o xviff.o xvtarga.o xvxpm.o xvcut.o \
! 	xvxwd.o xvfits.o xvmag.o xvmaki.o xvpic.o xvpi.o xvpic2.o xvpcd.o
  
  MISC = README INSTALL CHANGELOG IDEAS
  
***************
*** 230,241 ****
  
  
  install: all
! 	cp xv bggen vdcomp xcmap xvpictoppm $(BINDIR)
! 	cp docs/xv.man     $(MANDIR)/xv.$(MANSUF)
! 	cp docs/bggen.man  $(MANDIR)/bggen.$(MANSUF)
! 	cp docs/xcmap.man  $(MANDIR)/xcmap.$(MANSUF)
! 	cp docs/xvp2p.man  $(MANDIR)/xvpictoppm.$(MANSUF)
! 	cp docs/xvdocs.ps* $(LIBDIR)
  
  tar:
  	tar cvf xv.tar Makefile* Imakefile *.c *.h bits \
--- 235,250 ----
  
  
  install: all
! 	$(INSTALL) -c $(INSTPGMFLAGS) $(INSTBINFLAGS)  xv $(BINDIR)
! 	$(INSTALL) -c $(INSTPGMFLAGS) $(INSTBINFLAGS)  bggen $(BINDIR)
! 	$(INSTALL) -c $(INSTPGMFLAGS) $(INSTBINFLAGS)  vdcomp $(BINDIR)
! 	$(INSTALL) -c $(INSTPGMFLAGS) $(INSTBINFLAGS)  xcmap $(BINDIR)
! 	$(INSTALL) -c $(INSTPGMFLAGS) $(INSTBINFLAGS)  xvpictoppm $(BINDIR)
! 	$(INSTALL) -c $(INSTMANFLAGS) docs/xv.man $(MANDIR)/xv.$(MANSUFFIX)
! 	$(INSTALL) -c $(INSTMANFLAGS) docs/bggen.man $(MANDIR)/bggen.$(MANSUFFIX)
! 	$(INSTALL) -c $(INSTMANFLAGS) docs/xcmap.man $(MANDIR)/xcmap.$(MANSUFFIX)
! 	$(INSTALL) -c $(INSTMANFLAGS) docs/xvp2p.man $(MANDIR)/xvpictoppm.$(MANSUFFIX)
! 	$(INSTALL) -c $(INSTLIBFLAGS) docs/xvdocs.ps $(LIBDIR)
  
  tar:
  	tar cvf xv.tar Makefile* Imakefile *.c *.h bits \
diff -c -r xv-3.10magpic2pcd/Makefile.std xv-3.10magpic2pcdnew/Makefile.std
*** xv-3.10magpic2pcd/Makefile.std	Thu Jun 15 21:50:12 1995
--- xv-3.10magpic2pcdnew/Makefile.std	Thu Jun 15 19:52:15 1995
***************
*** 30,37 ****
  ### Installation locations
  BINDIR = /usr/local/bin
  MANDIR = /usr/local/man/man1
! MANSUF = 1
  LIBDIR = /usr/local/lib
  
  
  buildit: all
--- 30,42 ----
  ### Installation locations
  BINDIR = /usr/local/bin
  MANDIR = /usr/local/man/man1
! MANSUFFIX = 1
  LIBDIR = /usr/local/lib
+ INSTALL = install
+ INSTPGMFLAGS = -s
+ INSTBINFLAGS = -m 0755
+ INSTLIBFLAGS = -m 0644
+ INSTMANFLAGS = -m 0444
  
  
  buildit: all
***************
*** 189,195 ****
  	xvdial.o xvgraf.o xvsunras.o xvjpeg.o xvps.o xvpopup.o xvdflt.o \
  	xvtiff.o xvtiffwr.o xvpds.o xvrle.o xviris.o xvgrab.o vprintf.o \
  	xvbrowse.o xvtext.o xvpcx.o xviff.o xvtarga.o xvxpm.o xvcut.o \
! 	xvxwd.o xvfits.o xvmag.o xvmaki.o xvpic.o xvpi.o xvpic2.o xcpcd.o
  
  MISC = README INSTALL CHANGELOG IDEAS
  
--- 194,200 ----
  	xvdial.o xvgraf.o xvsunras.o xvjpeg.o xvps.o xvpopup.o xvdflt.o \
  	xvtiff.o xvtiffwr.o xvpds.o xvrle.o xviris.o xvgrab.o vprintf.o \
  	xvbrowse.o xvtext.o xvpcx.o xviff.o xvtarga.o xvxpm.o xvcut.o \
! 	xvxwd.o xvfits.o xvmag.o xvmaki.o xvpic.o xvpi.o xvpic2.o xvpcd.o
  
  MISC = README INSTALL CHANGELOG IDEAS
  
***************
*** 230,241 ****
  
  
  install: all
! 	cp xv bggen vdcomp xcmap xvpictoppm $(BINDIR)
! 	cp docs/xv.man     $(MANDIR)/xv.$(MANSUF)
! 	cp docs/bggen.man  $(MANDIR)/bggen.$(MANSUF)
! 	cp docs/xcmap.man  $(MANDIR)/xcmap.$(MANSUF)
! 	cp docs/xvp2p.man  $(MANDIR)/xvpictoppm.$(MANSUF)
! 	cp docs/xvdocs.ps* $(LIBDIR)
  
  tar:
  	tar cvf xv.tar Makefile* Imakefile *.c *.h bits \
--- 235,250 ----
  
  
  install: all
! 	$(INSTALL) -c $(INSTPGMFLAGS) $(INSTBINFLAGS)  xv $(BINDIR)
! 	$(INSTALL) -c $(INSTPGMFLAGS) $(INSTBINFLAGS)  bggen $(BINDIR)
! 	$(INSTALL) -c $(INSTPGMFLAGS) $(INSTBINFLAGS)  vdcomp $(BINDIR)
! 	$(INSTALL) -c $(INSTPGMFLAGS) $(INSTBINFLAGS)  xcmap $(BINDIR)
! 	$(INSTALL) -c $(INSTPGMFLAGS) $(INSTBINFLAGS)  xvpictoppm $(BINDIR)
! 	$(INSTALL) -c $(INSTMANFLAGS) docs/xv.man $(MANDIR)/xv.$(MANSUFFIX)
! 	$(INSTALL) -c $(INSTMANFLAGS) docs/bggen.man $(MANDIR)/bggen.$(MANSUFFIX)
! 	$(INSTALL) -c $(INSTMANFLAGS) docs/xcmap.man $(MANDIR)/xcmap.$(MANSUFFIX)
! 	$(INSTALL) -c $(INSTMANFLAGS) docs/xvp2p.man $(MANDIR)/xvpictoppm.$(MANSUFFIX)
! 	$(INSTALL) -c $(INSTLIBFLAGS) docs/xvdocs.ps $(LIBDIR)
  
  tar:
  	tar cvf xv.tar Makefile* Imakefile *.c *.h bits \
Only in xv-3.10magpic2pcdnew: README.pcd
Common subdirectories: xv-3.10magpic2pcd/bits and xv-3.10magpic2pcdnew/bits
diff -c -r xv-3.10magpic2pcd/config.h xv-3.10magpic2pcdnew/config.h
*** xv-3.10magpic2pcd/config.h	Thu Jun 15 21:50:16 1995
--- xv-3.10magpic2pcdnew/config.h	Thu Jun 15 19:18:23 1995
***************
*** 143,150 ****
   * '#define PIC2_SPLIT_MULTIBLOCKS' line.
   * On the other hand, blocks compose an image. (see 'xvpic2.c').
   *
-  * If you don't want dialog box that is opened when read PhotoCD image.
-  * *COMMENT OUT* '#define HAVE_PCD_DIALOG' line.
   */
  
  /* #define PIC_IGNORE_ASPECT */
--- 143,148 ----
***************
*** 151,159 ****
  
  /* #define PIC2_IGNORE_ASPECT */
  /* #define PIC2_SPLIT_MULTIBLOCKS */
- 
- #define HAVE_PCD_DIALOG
- 
  
  /***************************************************************************
   * MacBinary file support:
--- 149,154 ----
Common subdirectories: xv-3.10magpic2pcd/docs and xv-3.10magpic2pcdnew/docs
Common subdirectories: xv-3.10magpic2pcd/jpeg and xv-3.10magpic2pcdnew/jpeg
Common subdirectories: xv-3.10magpic2pcd/tiff and xv-3.10magpic2pcdnew/tiff
Common subdirectories: xv-3.10magpic2pcd/unsupt and xv-3.10magpic2pcdnew/unsupt
Common subdirectories: xv-3.10magpic2pcd/vms and xv-3.10magpic2pcdnew/vms
diff -c -r xv-3.10magpic2pcd/xv.c xv-3.10magpic2pcdnew/xv.c
*** xv-3.10magpic2pcd/xv.c	Thu Jun 15 21:50:20 1995
--- xv-3.10magpic2pcdnew/xv.c	Thu Jun 15 19:53:45 1995
***************
*** 78,83 ****
--- 78,84 ----
  
  static int    force8     = 0;   /* force 8-bit mode */
  static int    force24    = 0;   /* force 24-bit mode */
+ static int    PcdSize    = -1;   /* force dialog to ask */
  
  /* used in DeleteCmd() and Quit() */
  static char  **mainargv;
***************
*** 277,283 ****
    tiffW = (Window) NULL;  tiffUp = 0;
  #endif
  
!   pcdW = (Window) NULL;  pcdUp = 0;
  
    imap = ctrlmap = gmap = browmap = cmtmap = 0;
  
--- 278,284 ----
    tiffW = (Window) NULL;  tiffUp = 0;
  #endif
  
!     pcdW = (Window) NULL;  pcdUp = 0;
  
    imap = ctrlmap = gmap = browmap = cmtmap = 0;
  
***************
*** 1371,1376 ****
--- 1372,1382 ----
      else if (!argcmp(argv[i],"-norm",      5,1,&autonorm));   /* norm */
      else if (!argcmp(argv[i],"-nostat",    4,1,&nostat));     /* nostat */
      else if (!argcmp(argv[i],"-owncmap",   2,1,&owncmap));    /* own cmap */
+     else if (!argcmp(argv[i],"-pcd",4,0,&pm))	/* pcd with size */
+  	{ if (i+1<argc) {
+  		PcdSize = atoi(argv[++i]); 
+  		}
+  	}
      else if (!argcmp(argv[i],"-perfect",   3,1,&perfect));    /* -perfect */
      else if (!argcmp(argv[i],"-poll",      3,1,&polling));    /* chk mod? */
  
***************
*** 1628,1633 ****
--- 1634,1640 ----
    printoption("[-/+norm]");
    printoption("[-/+nostat]");
    printoption("[-/+owncmap]");
+   printoption("[-pcd size(0=192*128,1=384*256,2=768*512,3=1536*1024,4=3072*2048)]");
    printoption("[-/+perfect]");
    printoption("[-/+poll]");
    printoption("[-preset #]");
***************
*** 2705,2711 ****
    /* if quick is set, we're being called to generate icons, or something
       like that.  We should load the image as quickly as possible.  Currently,
       this only affects the LoadPS routine, which, if quick is set, only
!      generates the page file for the first page of the document */
  
    int rv = 0;
  
--- 2712,2719 ----
    /* if quick is set, we're being called to generate icons, or something
       like that.  We should load the image as quickly as possible.  Currently,
       this only affects the LoadPS routine, which, if quick is set, only
!      generates the page file for the first page of the document .
! 	 Also now affects PCD which now only loads a thumbnail */
  
    int rv = 0;
  
***************
*** 2750,2757 ****
    case RFT_PIC:     rv = LoadPIC   (fname, pinfo);  break;
    case RFT_PI:      rv = LoadPi    (fname, pinfo);  break;
    case RFT_PIC2:    rv = LoadPIC2  (fname, pinfo, quick);    break;
!   case RFT_PCD:     rv = LoadPCD   (fname, pinfo);  break;
  
    }
    return rv;
  }
--- 2758,2773 ----
    case RFT_PIC:     rv = LoadPIC   (fname, pinfo);  break;
    case RFT_PI:      rv = LoadPi    (fname, pinfo);  break;
    case RFT_PIC2:    rv = LoadPIC2  (fname, pinfo, quick);    break;
!   case RFT_PCD:      
! 	if (quick == 1)
! 		rv = LoadPCD(fname, pinfo, 0);  
! 	else
! 		rv = LoadPCD(fname, pinfo, PcdSize);  
! 	break;
  
+ 	/* If quick is switched on use the smallest image size don't ask
+ 	*	the user.
+ 	*/
    }
    return rv;
  }
diff -c -r xv-3.10magpic2pcd/xv.h xv-3.10magpic2pcdnew/xv.h
*** xv-3.10magpic2pcd/xv.h	Thu Jun 15 21:50:22 1995
--- xv-3.10magpic2pcdnew/xv.h	Thu Jun 15 19:54:48 1995
***************
*** 8,15 ****
  #include "config.h"
  
  
! #define REVDATE   "Version 3.10  Rev: 12/16/94"
! #define VERSTR    "3.10"
  
  /*
   * uncomment the following, and modify for your site, but only if you've
--- 8,15 ----
  #include "config.h"
  
  
! #define REVDATE   "Version 3.10PCDMagic2  Rev: 15/Jun/95"
! #define VERSTR    "3.10PCDMagic2"
  
  /*
   * uncomment the following, and modify for your site, but only if you've
***************
*** 113,118 ****
--- 113,119 ----
  #ifdef __STDC__
  #  include <stddef.h>
  #  include <stdlib.h>
+ #  include <unistd.h>
  #endif
  
  /* note: 'string.h' or 'strings.h' is included by Xos.h, and it
***************
*** 1675,1681 ****
  				 char *,char *,char *));
  
  /**************************** XVPCD.C ***************************/
! int   LoadPCD              PARM((char *, PICINFO *));
  void  CreatePCDW           PARM((void));
  void  PCDDialog            PARM((int));
  int   PCDCheckEvent        PARM((XEvent *));
--- 1676,1682 ----
  				 char *,char *,char *));
  
  /**************************** XVPCD.C ***************************/
! int   LoadPCD              PARM((char *, PICINFO *, int));
  void  CreatePCDW           PARM((void));
  void  PCDDialog            PARM((int));
  int   PCDCheckEvent        PARM((XEvent *));
diff -c -r xv-3.10magpic2pcd/xvbrowse.c xv-3.10magpic2pcdnew/xvbrowse.c
*** xv-3.10magpic2pcd/xvbrowse.c	Thu Jun 15 21:50:26 1995
--- xv-3.10magpic2pcdnew/xvbrowse.c	Thu Jun 15 22:02:43 1995
***************
*** 20,26 ****
  #define NEEDSDIR
  #include "xv.h"
  
! #ifdef VMS
  typedef unsigned int mode_t;  /* file mode bits */
  #endif
  
--- 20,26 ----
  #define NEEDSDIR
  #include "xv.h"
  
! #if defined(VMS) || defined(isc) || (defined(__sony_news) && defined(__bsd43))
  typedef unsigned int mode_t;  /* file mode bits */
  #endif
  
***************
*** 536,548 ****
    bfIcons[BF_XPM] =MakePix1(br->win,br_xpm_bits, br_xpm_width, br_xpm_height);
    bfIcons[BF_XWD] =MakePix1(br->win,br_xwd_bits, br_xwd_width, br_xwd_height);
    bfIcons[BF_FITS]=MakePix1(br->win,br_fits_bits,br_fits_width,br_fits_height);
!   bfIcons[BF_MAG] = MakePix1(br->win,br_mag_bits,br_mag_width,br_mag_height);
!   bfIcons[BF_MAKI] = MakePix1(br->win,br_maki_bits,
! 				 br_maki_width,br_maki_height);
!   bfIcons[BF_PIC] = MakePix1(br->win,br_pic_bits,br_pic_width,br_pic_height);
!   bfIcons[BF_PI]  = MakePix1(br->win,br_pi_bits,br_pi_width,br_pi_height);
    bfIcons[BF_PIC2]=MakePix1(br->win,br_pic2_bits,br_pic2_width,br_pic2_height);
!   bfIcons[BF_PCD] = MakePix1(br->win,br_pcd_bits,br_pcd_width,br_pcd_height);
  
  
    /* check that they all got built */
--- 537,548 ----
    bfIcons[BF_XPM] =MakePix1(br->win,br_xpm_bits, br_xpm_width, br_xpm_height);
    bfIcons[BF_XWD] =MakePix1(br->win,br_xwd_bits, br_xwd_width, br_xwd_height);
    bfIcons[BF_FITS]=MakePix1(br->win,br_fits_bits,br_fits_width,br_fits_height);
!   bfIcons[BF_MAG] =MakePix1(br->win,br_mag_bits, br_mag_width, br_mag_height);
!   bfIcons[BF_MAKI]=MakePix1(br->win,br_maki_bits,br_maki_width,br_maki_height);
!   bfIcons[BF_PIC] =MakePix1(br->win,br_pic_bits, br_pic_width, br_pic_height);
!   bfIcons[BF_PI]  =MakePix1(br->win,br_pi_bits,  br_pi_width,  br_pi_height);
    bfIcons[BF_PIC2]=MakePix1(br->win,br_pic2_bits,br_pic2_width,br_pic2_height);
!   bfIcons[BF_PCD] =MakePix1(br->win,br_pcd_bits, br_pcd_width, br_pcd_height);
  
  
    /* check that they all got built */
diff -c -r xv-3.10magpic2pcd/xvpcd.c xv-3.10magpic2pcdnew/xvpcd.c
*** xv-3.10magpic2pcd/xvpcd.c	Thu Jun 15 21:50:34 1995
--- xv-3.10magpic2pcdnew/xvpcd.c	Thu Jun 15 19:59:12 1995
***************
*** 1,7 ****
  /*
   * xvpcd.c - load routine for 'PhotoCD' format pictures
   *
!  * LoadPCD(fname, pinfo)  -  loads a PhotoCD file
   *
   * This routine will popup a choice of which of the 5 available resolutions
   * the user wants to choose, then load it as a 24 bit image.
--- 1,9 ----
+ #define trace (void)
+ 
  /*
   * xvpcd.c - load routine for 'PhotoCD' format pictures
   *
!  * LoadPCD(fname, pinfo, size)  -  loads a PhotoCD file
   *
   * This routine will popup a choice of which of the 5 available resolutions
   * the user wants to choose, then load it as a 24 bit image.
***************
*** 21,26 ****
--- 23,30 ----
   * factors, but I have calculated them from his tables and the results
   * look good enough to me.
   *
+  * Added size parameter to allow the schnautzer to create thumnails
+  * without requesting the size every time.
   */
  
  #include "xv.h"
***************
*** 33,39 ****
     not being able to malloc is a Fatal Error.  The program is aborted. */
  
  
! #ifdef __STDC__ 
  static void magnify(int, int, int, int, int, unsigned char *);
  static int pcdError(char *, char *);
  static int gethuffdata(char *, char *, char *, int, int);
--- 37,43 ----
     not being able to malloc is a Fatal Error.  The program is aborted. */
  
  
! #ifdef __STDC__
  static void magnify(int, int, int, int, int, unsigned char *);
  static int pcdError(char *, char *);
  static int gethuffdata(char *, char *, char *, int, int);
***************
*** 43,49 ****
  static int gethuffdata();
  #endif
  
- 
  #define wcurfactor 16		/* Call WaitCursor() every n rows */
  
  static char *bname;
--- 47,52 ----
***************
*** 55,64 ****
  
  static FILE  *fp;
  
  /*******************************************/
! int LoadPCD(fname, pinfo)
       char    *fname;
       PICINFO *pinfo;
  /*******************************************/
  {
    /* returns '1' on success */
--- 58,70 ----
  
  static FILE  *fp;
  
+ 
  /*******************************************/
! int LoadPCD(fname, pinfo,theSize)
       char    *fname;
       PICINFO *pinfo;
+ 	 int	theSize;
+ /* The size should be -1 for the popup to ask otherwise fast is assumed */
  /*******************************************/
  {
    /* returns '1' on success */
***************
*** 180,187 ****
  	- for base, the 16base chroma planes are then halved
  */
  
! #ifdef HAVE_PCD_DIALOG
!     PCDSetParamOptions(bname);
      PCDDialog(1);                   /* Open PCD Dialog box */
      SetCursors(-1);                 /* Somebody has already set it to wait :( */
      leaveitup=1;
--- 186,194 ----
  	- for base, the 16base chroma planes are then halved
  */
  
!   PCDSetParamOptions(bname);
!   if (theSize == -1)
!   {
      PCDDialog(1);                   /* Open PCD Dialog box */
      SetCursors(-1);                 /* Somebody has already set it to wait :( */
      leaveitup=1;
***************
*** 199,210 ****
        return 0;
      }
      WaitCursor();
! #else /* HAVE_PCD_DIALOG */
    {
!     static char *sizeoptions[3] = { "0192*128", "1384*256","2768*512" };
!     size=PopUp("Which of the stored resolutions would you like ?",sizeoptions,3);
    }
- #endif /* HAVE_PCD_DIALOG */
  
    switch (size) {
    case 0:
--- 206,217 ----
        return 0;
      }
      WaitCursor();
!   }
!   else 
    {
!     size = theSize;
!     goforit = 1;
    }
  
    switch (size) {
    case 0:
***************
*** 261,266 ****
--- 268,274 ----
  
    if (fseek(fp,offset,0) == -1)
      return pcdError(bname,"Can't find start of data.");
+ 
    w = pinfo->w;  h = pinfo->h;
    pic24 = pinfo->pic;
  
***************
*** 313,319 ****
        /* AND still being positioned in the "last" sector of the data */
        /* (cf. Hadmut's code which is positioned at start of the next sector) */
        long offset=ftell(fp)/0x800+13;
!       fprintf(stderr,"New offset=%ld\n",(long)offset);
        if (fseek(fp,offset*0x800,0) == -1) {
          return pcdError(bname,"Can't find start of huffman tables.");
        }
--- 321,327 ----
        /* AND still being positioned in the "last" sector of the data */
        /* (cf. Hadmut's code which is positioned at start of the next sector) */
        long offset=ftell(fp)/0x800+13;
!       trace(stderr,"New offset=%ld\n",(long)offset);
        if (fseek(fp,offset*0x800,0) == -1) {
          return pcdError(bname,"Can't find start of huffman tables.");
        }
***************
*** 432,440 ****
                   ((int)*(uptr++))+1)>>1;  /* last pixel */
      }
  
!     xvbcopy((char *) (p + (2*h-2)*mw),    /* 2nd last row */
!           (char *) (p + (2*h-1)*mw),      /* the last row */
!           (size_t) 2*w);                  /* length of a new row */
  
      h*=2; w*=2;
      mag>>=1;	/* Obviously mag must be a power of 2 ! */
--- 440,448 ----
                   ((int)*(uptr++))+1)>>1;  /* last pixel */
      }
  
!     xvbcopy(p + (2*h-2)*mw,                 /* 2nd last row */
!           p + (2*h-1)*mw,                 /* the last row */
!           2*w);                           /* length of a new row */
  
      h*=2; w*=2;
      mag>>=1;	/* Obviously mag must be a power of 2 ! */
***************
*** 460,475 ****
  #define T_BCANC  1
  #define BUTTH    24
  
! #ifdef __STDC__
! static void drawTD(int, int, int, int);
! static void clickTD(int, int);
! static void doCmd(int);
! static void PCDSetParams(void);
! #else
! static void drawTD(), doCmd(), clickTD(), PCDSetParams();
! #endif
  
- 
  /* local variables */
  static BUTT  tbut[T_NBUTTS];
  static RBUTT *resnRB;
--- 468,478 ----
  #define T_BCANC  1
  #define BUTTH    24
  
! static void drawTD    PARM((int, int, int, int));
! static void clickTD   PARM((int, int));
! static void doCmd     PARM((int));
! static void PCDSetParams PARM((void));
  
  /* local variables */
  static BUTT  tbut[T_NBUTTS];
  static RBUTT *resnRB;
***************
*** 568,573 ****
--- 571,578 ----
      stlen = XLookupString(e,buf,128,&ks,&status);
      buf[stlen] = '\0';
  
+     RemapKeyCheck(ks, buf, &stlen);
+ 
      if (e->window == pcdW) {
        if (stlen) {
  	if (buf[0] == '\r' || buf[0] == '\n') { /* enter */
***************
*** 623,629 ****
  
    for (i=0; i<T_NBUTTS; i++) BTRedraw(&tbut[i]);
  
!   ULineString(pcdW, "Resolution", resnRB->x-16, resnRB->y-10-DESCENT);
    RBRedraw(resnRB, -1);
  
    XDrawString(theDisp, pcdW, theGC, 20, 19, title, strlen(title));
--- 628,634 ----
  
    for (i=0; i<T_NBUTTS; i++) BTRedraw(&tbut[i]);
  
!   ULineString(pcdW, resnRB->x-16, resnRB->y-10-DESCENT, "Resolution");
    RBRedraw(resnRB, -1);
  
    XDrawString(theDisp, pcdW, theGC, 20, 19, title, strlen(title));
***************
*** 690,697 ****
    default: size = 0;     break;
    }
  }
- 
- #define trace (void)
  
  typedef char schar;  /* signed char */
  
--- 695,700 ----


