I've committed new exception handling code that is mainly
designed by Martin.
Now fit.c uses new exception handling code.
I'm working on input.c and output.c.
Please check. I'm much afraid of memory leaking.
This is the first time when I really want to use C++'s try/catch
facility:-P
Masatake
The input and output is different on OS/390. Could anyone adopt AutoTrace to
OS/390?
Thanks
Martin
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
The binary input and output is endian dependent. Can anyone test the binary
tga, bmp, pnm, pbm and ppm input and the emf and cgm output on a big endian
system.
Thanks
Martin
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
This doesn't seem to do anything; am I right?
It's fairly easily fudged if you stick
72 your_dpi_here div dup scale
after the %%BeginSetup, stick a showpage at the end, and recalculate the
%%BoundingBox using:
gs -dNOPAUSE -dBATCH -sDEVICE=bbox -r144 -g500000x500000 file.ps
Stewart
--
Stewart C. Russell Senior Analyst Programmer
stewart@... Collins Dictionaries
use Disclaimer; my $opinion; Bishopbriggs, Scotland
Stewart, if I'm writing no meaningful things, let me know and talk
to me more. I didn't understand well what you mean.
> This doesn't seem to do anything; am I right?
>
> It's fairly easily fudged if you stick
>
> 72 your_dpi_here div dup scale
>
> after the %%BeginSetup, stick a showpage at the end, and recalculate the
> %%BoundingBox using:
>
> gs -dNOPAUSE -dBATCH -sDEVICE=bbox -r144 -g500000x500000 file.ps
--dpi option is only effected on emf output.
--dpi is not effected on eps output. So...you are right.
Masatake
Masatake YAMATO wrote:
>
> --dpi option is only effected on emf output.
Ah, I see. It doesn't say that in the program help.
It does work nicely in emf mode, I will admit that.
Stewart
Hi,
if you give use some more infos we could also implement it for other output
formats like eps.
Martin
> Masatake YAMATO wrote:
> >
> > --dpi option is only effected on emf output.
>
> Ah, I see. It doesn't say that in the program help.
>
> It does work nicely in emf mode, I will admit that.
>
> Stewart
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
Martin Weber wrote:
>
> Hi,
>
> if you give use some more infos we could also implement it for other output
> formats like eps.
I thought I had in my first message. Alternatively, I could write an
output filter that will scale EPS output properly.
Stewart
It would be nice if you adopt the C code and send it directly to me.
Martin
> Martin Weber wrote:
> >
> > Hi,
> >
> > if you give use some more infos we could also implement it for other
> output
> > formats like eps.
>
> I thought I had in my first message. Alternatively, I could write an
> output filter that will scale EPS output properly.
>
> Stewart
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
So, send me an unmodified eps file and a modified one.
Martin
> Martin Weber wrote:
> >
> > It would be nice if you adopt the C code and send it directly to me.
>
> gave up C years ago, sorry.
>
> Stewart
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
> Masatake YAMATO wrote:
> >
> > --dpi option is only effected on emf output.
>
> Ah, I see. It doesn't say that in the program help.
Ok. I've just added the description abotu emf to help strings.
Masatake
Attached is a wee perl program I use to scale back Autotrace output to
its original size. Documentation is in the source in POD format.
This works for me, and could be useful for others.
Stewart
--
Stewart C. Russell Senior Analyst Programmer
stewart@... Collins Dictionaries
use Disclaimer; my $opinion; Bishopbriggs, Scotland
#!/usr/local/bin/perl -w
# scaleauto - make autotrace tracings the right size
# created by stewart@... on 02002/01/23
use strict;
use integer;
my $dpi=shift;
$dpi = int($dpi + 0);
if ($dpi <= 0) {
$dpi=300; # defaults to 300dpi on error
}
my $p='';
while (<>) {
if (/^%%BoundingBox: 0 0 /) { # recalc bounding box
# be careful with integers!
s/\s+$//;
s/\s+/ /g;
s/^%%BoundingBox: 0 0 //; # vape what we don't want
my ($urx, $ury) = split(' ', $_);
$urx = $urx * 72 / $dpi;
$ury = $ury * 72 / $dpi;
$_ = '%%BoundingBox: 0 0 ' . $urx . ' ' . $ury . "\n"; # rebuild for output
}
if ($p =~ /^%%BeginSetup/) { # scale the document
print '72 ', $dpi, ' div dup scale % dpi of input image = ', $dpi, "\n";
}
if ($p =~ /^%%Trailer/) { # some EPS programs like this
print 'showpage', "\n";
}
print $_;
$p=$_;
}
exit;
__END__
=head1 NAME
scaleauto - make autotrace tracings the right size
=head1 SYNOPSIS
scaleauto dpi [infile] [> outfile]
=head1 DESCRIPTION
Autotrace makes a good job of converting bit-mapped images to EPS, but
assumes that all images have been sampled at 72dpi. As most scanned
images are 300dpi or higher, the resulting EPS files don't fit on a
reasonable page size.
scaleauto allows you to rescale Autotrace output based on the
resolution of the original image.
=head1 OPTIONS
dpi -- integer value
=head1 EXAMPLES
scaleauto 720 file.eps > newfile.eps
would produce an output file scaled to 10% of its original size.
=head1 SEE ALSO
autotrace, perl
=head1 NOTES
Tested with B&W output from version 0.29 only.
In theory, EPS should be infinitely scalable, but in practice, most
packages limit EPS scaling to a set range. QuarkXPress, for instance,
only allows scaling of EPS images from 0.1--10x.
Adds a "showpage" command to the end of the file. This might break
strict AI compliance, but means the image will render on a wider
variety of platforms.
=head1 CAVEATS
Works with version 0.29, but won't work with output from many earlier
versions (including 0.16) as the EPS format is slightly different.
=head1 BUGS
Very crude, so likely to have some problems in the future.
=head1 AUTHOR
Stewart C. Russell
=head1 HISTORY
Created 02002/01/23 by stewart@...
=cut
I've run tests on sparc(32bit?, big endian) and alpha(64bit, little endian) at
compilefarm.sourceforge.net. I've tested both non-centerline(outline?) and
centerline.
bmp, pbm, ppm and tga were tested as inputs.
The eps outputs on sparc and alpha are almost the same that on i686 for my eyes.
The inputs for test, test drivers and the eps output of these 3 platforms are in
ftp://ftp.gyve.org/pub/misc/attest.tar.gz
If you'd like to add a new test and/or a new input, post a mail to this list.
I'll run the test on the compilefarm.
Msatake YAMATO
Great! Could you also test the cgm and emf output.
Thanks
Martin
masata-y@... schrieb:
> I've run tests on sparc(32bit?, big endian) and alpha(64bit, little endian) at
> compilefarm.sourceforge.net. I've tested both non-centerline(outline?) and
centerline.
> bmp, pbm, ppm and tga were tested as inputs.
>
> The eps outputs on sparc and alpha are almost the same that on i686 for my
eyes.
>
> The inputs for test, test drivers and the eps output of these 3 platforms are
in
> ftp://ftp.gyve.org/pub/misc/attest.tar.gz
>
> If you'd like to add a new test and/or a new input, post a mail to this list.
> I'll run the test on the compilefarm.
>
> Msatake YAMATO
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Man page for autotrace is contributed by R. P. Channing Rodgers.
And I've just commited the file to our CVS repository.
Rick, Thank you.
Masatake YAMATO
I do not know such viewers, but send the results to me and I will check.
Byt the way there is a Linux version of CorelDraw which load such files.
Martin
Masatake YAMATO schrieb:
> > Great! Could you also test the cgm and emf output.
>
> I need viewers for cgm and emf to test.
> Do you know viewers that runs on GNU/Linux?
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Dear Masatake,
I think the testing of emf and cgm output can be done much simpler. The
ouput has to be identical on all platforms byte for byte. So do just a
compare.
Martin
I am attempting to compile and execute Autotrace on a Macintosh running
Mac OS X. Is there anything I should know about before entering upon
this fools journey?
Thanks!
Travis Hamilton
>I am attempting to compile and execute Autotrace on a Macintosh
>running Mac OS X. Is there anything I should know about before
>entering upon this fools journey?
Well, just be aware that Autotrace depends on other
library's/applications for much of it's input/output functionality.
Unless you also compile and install those first Autotrace will be
limited in it's capabilities.
Haven't got round to compiling Autotrace 0.29 on OS X 10.1 yet - in
fact I think I'm gonna try it now. I'll let you know how it goes.
--
Adrian
e-mail <mailto:adrian@...>
Web Site <http://www.cubitum.co.uk>
NS/AOL Instant Message ID <adrianatcubitum>
Ok, I now have Autotrace working on OS X.
I use Fink to install a lot of open source/gnu/*nix software:
<http://fink.sourceforge.net/doc/porting/index.php>
One thing I have installed with this is libpng (I'm also in the
process of installing ImageMagik with Fink, I'll recompile
--with-magick when that's done).
So having done:
gnutar xvzf autotrace-0.29.tar.gz
cd autotrace-0.29
I did this to make sure ./configure found libpng and its headers:
setenv CFLAGS "-I/sw/include"
setenv LDFLAGS "-L/sw/lib"
then ran configure (Darwin - the BSD part of OS X - puts its man
files in /usr/share):
./configure --infodir=/usr/share/info --mandir=/usr/share/man --without-magick
Quick test with a simple png (several black squares and an oval on a
white background), and output to pdf worked fine - with the exception
that Apple's 'Preview' didn't show the PDF correctly, although
Adobe's Acrobat Reader 5 for OS X worked perfectly.
HTH someone
This makes me want to play with Applescript studio, see if I can't
make a little app that runs Autotrace and previews the results as a
pdf...
--
Adrian
e-mail <mailto:adrian@...>
Web Site <http://www.cubitum.co.uk>
NS/AOL Instant Message ID <adrianatcubitum>
oops.
In my last post neglected to say that /sw is where fink installs
everything, not the usual /usr hierarchy. And of course that I did
'make' after ./configure....
It's late here.
--
Adrian
e-mail <mailto:adrian@...>
Web Site <http://www.cubitum.co.uk>
NS/AOL Instant Message ID <adrianatcubitum>
Adrian Simmons wrote:
>
> Quick test with a simple png (several black squares and an oval on a
> white background), and output to pdf worked fine - with the exception
> that Apple's 'Preview' didn't show the PDF correctly, although
> Adobe's Acrobat Reader 5 for OS X worked perfectly.
I've noticed several PDF readers take exception to Autotrace's PDF
output. gv won't read it at all, xpdf complains about broken xref tables
(as does pdfTeX) but seems to work.
autotracing to eps, and then feeding that through epstopdf, makes a
smaller file with no warnings/errors.
Stewart
--
Stewart C. Russell CEng MBCS Senior Analyst Programmer
stewart@... Collins Dictionaries
use Disclaimer; my $opinion; Bishopbriggs, Scotland
You are right, there are no xref tables. Can anyone tell me how to create
such tables at the beginning of the document. I would like to add this in the
next version.
Martin
> Adrian Simmons wrote:
> >
> > Quick test with a simple png (several black squares and an oval on a
> > white background), and output to pdf worked fine - with the exception
> > that Apple's 'Preview' didn't show the PDF correctly, although
> > Adobe's Acrobat Reader 5 for OS X worked perfectly.
>
> I've noticed several PDF readers take exception to Autotrace's PDF
> output. gv won't read it at all, xpdf complains about broken xref tables
> (as does pdfTeX) but seems to work.
>
> autotracing to eps, and then feeding that through epstopdf, makes a
> smaller file with no warnings/errors.
>
> Stewart
>
> --
> Stewart C. Russell CEng MBCS Senior Analyst Programmer
> stewart@... Collins Dictionaries
> use Disclaimer; my $opinion; Bishopbriggs, Scotland
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
Normally such tables are created at the end of a document, since you need to
know the file positions (in terms of bytes)
of the individual pdf objects. In case of autotrace the solution might be
simpler since you have just one page and no
font description object and the like. So you may be able to anticipate the
positions in advance. One further thing to keep
in mind is the byte count of a newline. Under Unix this is one byte, whereas
under Win it counts two.
Wolfgang
-----Original Message-----
From: Martin Weber [mailto:martweb@...]
Sent: Montag, 4. Februar 2002 15:03
To: autotrace@yahoogroups.com
Subject: Re: [AutoTrace] pdf output
You are right, there are no xref tables. Can anyone tell me how to create
such tables at the beginning of the document. I would like to add this in the
next version.
Martin
> Adrian Simmons wrote:
> >
> > Quick test with a simple png (several black squares and an oval on a
> > white background), and output to pdf worked fine - with the exception
> > that Apple's 'Preview' didn't show the PDF correctly, although
> > Adobe's Acrobat Reader 5 for OS X worked perfectly.
>
> I've noticed several PDF readers take exception to Autotrace's PDF
> output. gv won't read it at all, xpdf complains about broken xref tables
> (as does pdfTeX) but seems to work.
>
> autotracing to eps, and then feeding that through epstopdf, makes a
> smaller file with no warnings/errors.
>
> Stewart
>
> --
> Stewart C. Russell CEng MBCS Senior Analyst Programmer
> stewart@... Collins Dictionaries
> use Disclaimer; my $opinion; Bishopbriggs, Scotland
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Well, that's me about to emigrate to Canada. I'll be off the net for a
bit.
Thanks for developing such a nifty program.
cheers,
Stewart
--
Stewart C. Russell CEng MBCS Senior Analyst Programmer
stewart@... Collins Dictionaries
use Disclaimer; my $opinion; Bishopbriggs, Scotland
AutoTrace has several weaknesses so we have to do some redesigns. One will
be to add a new way to handle lists. This could be either done using STL or
glib. STL will lead to a better performance on an Intel PC, but we will have to
use C++. As earlier mails showed that the acceptance of C++ for many people
who helped to improve AutoTrace is low. I personally like C++, but I also
accept not to use it. Glib also has several other interesting functionality as
an interesting plugin concept so we will use it in future versions (0.31 or
later). If you have any comments on this please feel free to send them to this
mailing list.
Martin
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net