Dave Uhring on Fri, 23 Mar 2001 04:52:27 +0100 (CET)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: apsfilter: unsupported file type '/tmp/apsfilter1561/header1: PostScript document' (fwd)


On Thursday 22 March 2001 16:11, Andreas Klemm wrote:
> On Wed, Mar 21, 2001 at 09:43:48PM -0600, Dave Uhring wrote:
> > I finally got it print PostScript.  Replaced #!/bin/sh with
> > #!/usr/bin/bash.  Replaced awk with gawk.  Modified unpack routine
> > as follows:
> >
> > unpack()
> > {
> >     local HEADER FILE_TYPE unpacker
> >
> >     DEPTH=$(($DEPTH + 1))
> >     HEADER="$APS_TMPDIR/header$DEPTH"
> >     dd bs=1k count=16 > "$HEADER" 2> /dev/null
> >
> >     FILE_TYPE=`file "$HEADER" | awk '{print $2}'`
> >     FILE_TYPE=`echo $FILE_TYPE | tr [:upper:] [:lower:]`
> >
> >
> >     unpacker=
> >     case "$FILE_TYPE" in
> >
> > Have tested only with .ps file so far, but it works on that.
>
> diff -u please and Cc: to the list.
>
> 	Andreas ///

Here is the diff which you requested in line:

--- apsfilter.orig	Tue Mar 20 09:00:09 2001
+++ apsfilter	Wed Mar 21 21:39:51 2001
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /usr/bin/bash
 # -*- sh -*-

 # $ApsCVS: src/apsfilter/bin/apsfilter,v 1.190.2.7 2001/03/20 15:00:09 
andreas Exp $
@@ -60,7 +60,7 @@
 # Set a basic PATH; might have to be extended in $CONF_DIR/apsfilterrc
 #----------------------------------------------------------------------
-------

-PATH="/usr/local/bin:/usr/X11R6/bin:/usr/bin:/bin"
+PATH="/opt/sfw/bin:/usr/local/bin:/usr/X11R6/bin:/usr/bin:/bin"

 #----------------------------------------------------------------------
-------
 # apsfilter version; don't change this
@@ -1362,8 +1362,10 @@
     DEPTH=$(($DEPTH + 1))
     HEADER="$APS_TMPDIR/header$DEPTH"
     dd bs=1k count=16 > "$HEADER" 2> /dev/null
-    FILE_TYPE=`file "$HEADER"`
-    FILE_TYPE=`echo ${FILE_TYPE#$HEADER: } | tr A-Z a-z`
+
+    FILE_TYPE=`file "$HEADER" | awk '{print $2}'`
+    FILE_TYPE=`echo $FILE_TYPE | tr [:upper:] [:lower:]`
+
 
     unpacker=
     case "$FILE_TYPE" in

and as an attachment.

I attempted to print a .png file and was unsuccessful, just garbage 
output, but .jpg print was successful.  So far, .ps, text & .jpg work.  
Will continue to dig deeper into the problems as I test and find them.

Dave
--- apsfilter.orig	Tue Mar 20 09:00:09 2001
+++ apsfilter	Wed Mar 21 21:39:51 2001
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /usr/bin/bash
 # -*- sh -*-
 
 # $ApsCVS: src/apsfilter/bin/apsfilter,v 1.190.2.7 2001/03/20 15:00:09 andreas Exp $
@@ -60,7 +60,7 @@
 # Set a basic PATH; might have to be extended in $CONF_DIR/apsfilterrc
 #-----------------------------------------------------------------------------
 
-PATH="/usr/local/bin:/usr/X11R6/bin:/usr/bin:/bin"
+PATH="/opt/sfw/bin:/usr/local/bin:/usr/X11R6/bin:/usr/bin:/bin"
 
 #-----------------------------------------------------------------------------
 # apsfilter version; don't change this
@@ -1362,8 +1362,10 @@
     DEPTH=$(($DEPTH + 1))
     HEADER="$APS_TMPDIR/header$DEPTH"
     dd bs=1k count=16 > "$HEADER" 2> /dev/null
-    FILE_TYPE=`file "$HEADER"`
-    FILE_TYPE=`echo ${FILE_TYPE#$HEADER: } | tr A-Z a-z`
+
+    FILE_TYPE=`file "$HEADER" | awk '{print $2}'`
+    FILE_TYPE=`echo $FILE_TYPE | tr [:upper:] [:lower:]`
+
 
     unpacker=
     case "$FILE_TYPE" in