Hylafax Mailing List Archives

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

Re: Faxmail bug with attachments



At 10:29 02/12/98 +1000, "Campbell, Peter K" wrote:
>[snip]
>I've set up netpbm & the jpeg distribution & currently have it working
>with gifs & jpegs.  However, there is one problem - the first attachment
>does not display.  It's there in the postscript output, but effectively
>invisible - I eventually worked out that the way to fix this is to add a
>"showpage" to the postscript before the first attachment (others are
>fine, the netpbm stuff automatically adds showpage at the end of
>each).
>
>I think this is a bug in Hylafax, with some coded needed to be added
>to faxmail.c++ in the faxmail subdirectory - probably in formatMIME
>so that the first time formatWithExternal is called a showpage is
>added.
>[snip]

Hi, Peter,

You may be exactly the person to help us with this. Yes, the bug is
known - it's on the TODO list as report #0019. There's was long thread
in the mailing list archives in October 1997 with the subject

            "postscript attachments show up at 5% size"

and since the mailing list archives are down at the moment, I will put
them on my own website over the weekend for your interest. Ben Parker,
Louis Reinard, and myself concluded that an additional 'showpage'
instruction was required before a postscript attachment if on the first
page of a fax.

Ben produced some workrounds, this is one example :

#!/usr/bin/bash
#This script will let the GIF image through but 
#will try to squeeze it on the same page
#/usr/local/sbin/faxmail/image/gif
giftopnm $1 | ppmtopgm | pnmtops -scale 20

here is another :

#!/usr/bin/perl
#
# This file needs to be called:
# /usr/local/sbin/faxmail/application/postscript
# and have the +x bit set.
#
# Script to work with Hylafax's faxmail.
# It attempts to blow up attached postscript to full size on
# the next page, instead of shrinking it to 5% on page one 
# which is the default in faxmail.
#
# Your mileage will definitely vary.
# Seems to work with golfer.ps and tiger.ps in the 
# ghostscript/3.33/examples directory
#
# Ben Parker <ben@dha.unon.org> Dec 97 
#
#
open (TEMP, "$ARGV[0]") || die "$ARGV[0] file not found.\n";
print STDERR "$ARGV[0] opened ...\n";
while (<TEMP>) {
	if ($_ =~ "EndProlog") {
		print "\% line inserted to blow up size\n";
		print "showpage\n";
	}
	print $_;
}

# end of script

The reasons for not incorporating this approach into faxmail.c++ and
textfmt.c++ is, in my opinion (please put me right if you disagree):

1. It is not legal postscript code. Ghostview thinks that there is 
   only one page, but shows either page image at random.

2. The solution of forcing the attachment onto a new page is too crude;
   what if the attachment is a page footer banner? Or what if there is
   no message body at all before the attachment?

3. It would still fail for unusual multi-part situations, particularly
   where a text/plain attachment follows an application/postscript
   attachment. 

So a more flexible solution based on a wrapper around each attachment
was being considered. Which is where in the story the mystery of the 
faxmail prologue file, faxmail.ps, comes in. No-one knows what this
file is for. The default file, shown below, has no effect whatsoever
on the generated image :

   %       $Id: faxmail.c++,v 1.56 1996/07/02 19:49:58 sam Exp sam
   %
   % faxmail prologue.
   %
   /EPSbegin{save gsave 20 20 scale 200 dict begin}def
   /EPSend{end grestore restore}def

But if you are creating functions to put at the start and end of a
postscript attachment, you might call them EPSbegin and EPSend, perhaps?
Like Robinson Crusoe walking on the beach, suddenly there's a sign
that someone been here before....

And this where we are stuck.

If you have some expertise in the Postscript language, and happy to 
delve into the faxmail and textfmt C++ source code, then your help and
input would be very much appreciated.

Regards,
Phil Watkinson,
Boston, UK.



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services