2009-10-21 15:11:20 +00:00
|
|
|
diff -up netpbm-10.47.04/converter/other/anytopnm.security2 netpbm-10.47.04/converter/other/anytopnm
|
|
|
|
--- netpbm-10.47.04/converter/other/anytopnm.security2 2009-10-21 13:39:06.000000000 +0200
|
|
|
|
+++ netpbm-10.47.04/converter/other/anytopnm 2009-10-21 14:51:49.000000000 +0200
|
|
|
|
@@ -510,10 +510,7 @@ else
|
2005-03-29 14:08:28 +00:00
|
|
|
inputFile="-"
|
|
|
|
fi
|
2004-09-09 09:17:25 +00:00
|
|
|
|
2005-03-29 14:08:28 +00:00
|
|
|
-tempdir="${TMPDIR-/tmp}/anytopnm.$$"
|
2009-10-21 15:11:20 +00:00
|
|
|
-mkdir -m 0700 $tempdir || \
|
|
|
|
- { echo "Could not create temporary file. Exiting."; exit 1;}
|
2005-06-10 09:16:43 +00:00
|
|
|
-trap 'rm -rf $tempdir' 0
|
2005-03-29 14:08:28 +00:00
|
|
|
+tempdir=$(mktemp -d -t anytopnm.XXXXXXXXXX) || exit 1
|
2004-09-09 09:17:25 +00:00
|
|
|
|
2008-08-04 07:05:23 +00:00
|
|
|
# Take out all spaces
|
|
|
|
# Find the filename extension for last-ditch efforts later
|
2009-10-21 15:11:20 +00:00
|
|
|
@@ -539,9 +536,17 @@ if [ "$filetype" = "unknown" ]; then
|
2005-03-29 14:08:28 +00:00
|
|
|
echo "$progname: unknown file type. " \
|
|
|
|
"'file' says mime type is '$mimeType', " 1>&2
|
|
|
|
echo "type description is '$typeDescription'" 1>&2
|
|
|
|
+ if [ -d "$tempdir" ] ; then
|
|
|
|
+ rm -rf "$tempdir"
|
2004-09-09 09:17:25 +00:00
|
|
|
+ fi
|
2005-03-29 14:08:28 +00:00
|
|
|
+
|
2004-09-09 09:17:25 +00:00
|
|
|
exit 1
|
2005-03-29 14:08:28 +00:00
|
|
|
fi
|
2004-09-09 09:17:25 +00:00
|
|
|
|
2005-03-29 14:08:28 +00:00
|
|
|
convertIt $file $filetype
|
2004-09-09 09:17:25 +00:00
|
|
|
|
2005-03-29 14:08:28 +00:00
|
|
|
+if [ -d "$tempdir" ] ; then
|
|
|
|
+ rm -rf "$tempdir"
|
2004-09-09 09:17:25 +00:00
|
|
|
+fi
|
2005-03-29 14:08:28 +00:00
|
|
|
+
|
|
|
|
exit 0
|
2009-10-21 15:11:20 +00:00
|
|
|
diff -up netpbm-10.47.04/editor/pamstretch-gen.security2 netpbm-10.47.04/editor/pamstretch-gen
|
|
|
|
--- netpbm-10.47.04/editor/pamstretch-gen.security2 2009-10-21 13:38:57.000000000 +0200
|
|
|
|
+++ netpbm-10.47.04/editor/pamstretch-gen 2009-10-21 14:53:28.000000000 +0200
|
|
|
|
@@ -31,9 +31,7 @@ if [ "$1" = "" ]; then
|
2008-08-04 07:05:23 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
-tempdir="${TMPDIR-/tmp}/pamstretch-gen.$$"
|
2009-10-21 15:11:20 +00:00
|
|
|
-mkdir -m 0700 $tempdir || \
|
|
|
|
- { echo "Could not create temporary file. Exiting."; exit 1;}
|
2008-08-04 07:05:23 +00:00
|
|
|
+tempfile=$(mktemp /tmp/pnmig.XXXXXXXXXX) || exit 1
|
|
|
|
trap 'rm -rf $tempdir' 0 1 3 15
|
|
|
|
|
2009-10-21 15:11:20 +00:00
|
|
|
tempfile=$tempdir/pnmig
|
|
|
|
diff -up netpbm-10.47.04/editor/pnmmargin.security2 netpbm-10.47.04/editor/pnmmargin
|
|
|
|
--- netpbm-10.47.04/editor/pnmmargin.security2 2009-10-21 13:38:57.000000000 +0200
|
|
|
|
+++ netpbm-10.47.04/editor/pnmmargin 2009-10-21 14:55:40.000000000 +0200
|
|
|
|
@@ -11,15 +11,11 @@
|
2008-08-04 07:05:23 +00:00
|
|
|
# documentation. This software is provided "as is" without express or
|
|
|
|
# implied warranty.
|
|
|
|
|
|
|
|
-tempdir="${TMPDIR-/tmp}/pnmmargin.$$"
|
2009-10-21 15:11:20 +00:00
|
|
|
-mkdir -m 0700 $tempdir || \
|
|
|
|
- { echo "Could not create temporary file. Exiting." 1>&2; exit 1;}
|
2008-08-04 07:05:23 +00:00
|
|
|
-trap 'rm -rf $tempdir' 0 1 3 15
|
|
|
|
-
|
|
|
|
-tmp1=$tempdir/pnmm1
|
|
|
|
-tmp2=$tempdir/pnmm2
|
|
|
|
-tmp3=$tempdir/pnmm3
|
|
|
|
-tmp4=$tempdir/pnmm4
|
|
|
|
+tmpdir=$(mktemp -d -t ppmmargin.XXXXXXX) || exit 1
|
|
|
|
+tmp1="$tmpdir/tmp1"
|
|
|
|
+tmp2="$tmpdir/tmp2"
|
|
|
|
+tmp3="$tmpdir/tmp3"
|
|
|
|
+tmp4="$tmpdir/tmp4"
|
|
|
|
|
|
|
|
color="-gofigure"
|
2009-10-21 15:11:20 +00:00
|
|
|
plainopt=""
|
|
|
|
@@ -43,6 +39,9 @@ while true ; do
|
2008-08-04 07:05:23 +00:00
|
|
|
shift
|
|
|
|
if [ ! ${1-""} ] ; then
|
2009-10-21 15:11:20 +00:00
|
|
|
echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
|
2008-08-04 07:05:23 +00:00
|
|
|
+ if [ -d "$tmpdir" ]; then
|
|
|
|
+ rm -rf "$tmpdir"
|
|
|
|
+ fi
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
color="$1"
|
2009-10-21 15:11:20 +00:00
|
|
|
@@ -50,6 +49,9 @@ while true ; do
|
2008-08-04 07:05:23 +00:00
|
|
|
;;
|
|
|
|
-* )
|
|
|
|
echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
|
|
|
|
+ if [ -d "$tmpdir" ]; then
|
|
|
|
+ rm -rf "$tmpdir"
|
|
|
|
+ fi
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
* )
|
2009-10-21 15:11:20 +00:00
|
|
|
@@ -60,6 +62,9 @@ done
|
2008-08-04 07:05:23 +00:00
|
|
|
|
|
|
|
if [ ! ${1-""} ] ; then
|
|
|
|
echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
|
|
|
|
+ if [ -d "$tmpdir" ]; then
|
|
|
|
+ rm -rf "$tmpdir"
|
|
|
|
+ fi
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
size="$1"
|
2009-10-21 15:11:20 +00:00
|
|
|
@@ -67,6 +72,9 @@ shift
|
2008-08-04 07:05:23 +00:00
|
|
|
|
|
|
|
if [ ${2-""} ] ; then
|
|
|
|
echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
|
|
|
|
+ if [ -d "$tmpdir" ]; then
|
|
|
|
+ rm -rf "$tmpdir"
|
|
|
|
+ fi
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2009-10-21 15:11:20 +00:00
|
|
|
@@ -103,6 +111,6 @@ else
|
|
|
|
pnmcat -tb $plainopt $tmp3 $tmp4 $tmp3
|
|
|
|
fi
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
2008-08-04 07:05:23 +00:00
|
|
|
+if [ -d "$tmpdir" ]; then
|
|
|
|
+ rm -rf "$tmpdir"
|
|
|
|
+fi
|
2009-10-21 15:11:20 +00:00
|
|
|
diff -up netpbm-10.47.04/editor/ppmfade.security2 netpbm-10.47.04/editor/ppmfade
|
|
|
|
--- netpbm-10.47.04/editor/ppmfade.security2 2009-10-21 13:38:57.000000000 +0200
|
|
|
|
+++ netpbm-10.47.04/editor/ppmfade 2009-10-21 15:03:01.000000000 +0200
|
2004-09-09 09:17:25 +00:00
|
|
|
@@ -14,6 +14,7 @@
|
|
|
|
#
|
|
|
|
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
|
|
use strict;
|
|
|
|
+use File::Temp "tempdir";
|
|
|
|
|
|
|
|
my $SPREAD = 1;
|
|
|
|
my $SHIFT = 2;
|
2009-10-21 15:11:20 +00:00
|
|
|
@@ -111,20 +112,26 @@ if ($first_file ne "undefined") {
|
2004-09-09 09:17:25 +00:00
|
|
|
|
|
|
|
print("Frames are " . $width . "W x " . $height . "H\n");
|
|
|
|
|
|
|
|
+#
|
|
|
|
+# We create a tmp-directory right here
|
|
|
|
+#
|
|
|
|
+my $tmpdir = tempdir("ppmfade.XXXXXX", CLEANUP => 1);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
if ($first_file eq "undefined") {
|
|
|
|
print "Fading from black to ";
|
|
|
|
- system("ppmmake \\#000 $width $height >junk1$$.ppm");
|
|
|
|
+ system("ppmmake \\#000 $width $height >$tmpdir/junk1$$.ppm");
|
|
|
|
} else {
|
|
|
|
print "Fading from $first_file to ";
|
|
|
|
- system("cp", $first_file, "junk1$$.ppm");
|
|
|
|
+ system("cp", $first_file, "$tmpdir/junk1$$.ppm");
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($last_file eq "undefined") {
|
|
|
|
print "black.\n";
|
|
|
|
- system("ppmmake \\#000 $width $height >junk2$$.ppm");
|
|
|
|
+ system("ppmmake \\#000 $width $height >$tmpdir/junk2$$.ppm");
|
|
|
|
} else {
|
|
|
|
print "$last_file\n";
|
|
|
|
- system("cp", $last_file, "junk2$$.ppm");
|
|
|
|
+ system("cp", $last_file, "$tmpdir/junk2$$.ppm");
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
2009-10-21 15:11:20 +00:00
|
|
|
@@ -132,14 +139,14 @@ if ($last_file eq "undefined") {
|
2005-03-29 14:08:28 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# Here's what our temporary files are:
|
|
|
|
-# junk1$$.ppm: The original (fade-from) image
|
|
|
|
-# junk2$$.ppm: The target (fade-from) image
|
|
|
|
-# junk3$$.ppm: The frame of the fade for the current iteration of the
|
|
|
|
-# the for loop.
|
|
|
|
-# junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate
|
|
|
|
-# image to another, this is the first frame of that
|
|
|
|
-# sequence.
|
|
|
|
-# junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence
|
|
|
|
+# $tmpdir/junk1$$.ppm: The original (fade-from) image
|
|
|
|
+# $tmpdir/junk2$$.ppm: The target (fade-from) image
|
|
|
|
+# $tmpdir/junk3$$.ppm: The frame of the fade for the current iteration of the
|
|
|
|
+# the for loop.
|
|
|
|
+# $tmpdir/junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate
|
|
|
|
+# image to another, this is the first frame of that
|
|
|
|
+# sequence.
|
|
|
|
+# $tmpdir/junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence
|
|
|
|
|
|
|
|
my $i; # Frame number
|
|
|
|
for ($i = 1; $i <= $nframes; $i++) {
|
2009-10-21 15:11:20 +00:00
|
|
|
@@ -147,147 +154,147 @@ for ($i = 1; $i <= $nframes; $i++) {
|
2004-09-09 09:17:25 +00:00
|
|
|
if ($mode eq $SPREAD) {
|
|
|
|
if ($i <= 10) {
|
|
|
|
my $n = $spline20[$i] * 100;
|
|
|
|
- system("ppmspread $n junk1$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmspread $n $tmpdir/junk1$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} elsif ($i <= 20) {
|
|
|
|
my $n;
|
|
|
|
$n = $spline20[$i] * 100;
|
|
|
|
- system("ppmspread $n junk1$$.ppm >junk1a$$.ppm");
|
|
|
|
+ system("ppmspread $n $tmpdir/junk1$$.ppm >$tmpdir/junk1a$$.ppm");
|
|
|
|
$n = (1-$spline20[$i-10]) * 100;
|
|
|
|
- system("ppmspread $n junk2$$.ppm >junk2a$$.ppm");
|
|
|
|
+ system("ppmspread $n $tmpdir/junk2$$.ppm >$tmpdir/junk2a$$.ppm");
|
|
|
|
$n = $spline10[$i-10];
|
|
|
|
- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} else {
|
|
|
|
my $n = (1-$spline20[$i-10])*100;
|
|
|
|
- system("ppmspread $n junk2$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmspread $n $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
}
|
|
|
|
} elsif ($mode eq $SHIFT) {
|
|
|
|
if ($i <= 10) {
|
|
|
|
my $n = $spline20[$i] * 100;
|
|
|
|
- system("ppmshift $n junk1$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmshift $n $tmpdir/junk1$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} elsif ($i <= 20) {
|
|
|
|
my $n;
|
|
|
|
$n = $spline20[$i] * 100;
|
|
|
|
- system("ppmshift $n junk1$$.ppm >junk1a$$.ppm");
|
|
|
|
+ system("ppmshift $n $tmpdir/junk1$$.ppm >$tmpdir/junk1a$$.ppm");
|
|
|
|
$n = (1-$spline20[$i-10])*100;
|
|
|
|
- system("ppmshift $n junk2$$.ppm >junk2a$$.ppm");
|
|
|
|
+ system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk2a$$.ppm");
|
|
|
|
$n = $spline10[$i-10];
|
|
|
|
- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} else {
|
|
|
|
my $n = (1-$spline20[$i-10]) * 100;
|
|
|
|
- system("ppmshift $n junk2$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
}
|
|
|
|
} elsif ($mode eq $RELIEF) {
|
|
|
|
if ($i == 1) {
|
|
|
|
- system("ppmrelief junk1$$.ppm >junk1r$$.ppm");
|
|
|
|
+ system("ppmrelief $tmpdir/junk1$$.ppm >$tmpdir/junk1r$$.ppm");
|
|
|
|
}
|
|
|
|
if ($i <= 10) {
|
|
|
|
my $n = $spline10[$i];
|
|
|
|
- system("ppmmix $n junk1$$.ppm junk1r$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1r$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} elsif ($i <= 20) {
|
|
|
|
my $n = $spline10[$i-10];
|
|
|
|
- system("ppmmix $n junk1r$$.ppm junk2r$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk1r$$.ppm $tmpdir/junk2r$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} else {
|
|
|
|
my $n = $spline10[$i-20];
|
|
|
|
- system("ppmmix $n junk2r$$.ppm junk2$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk2r$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
}
|
|
|
|
if ($i == 10) {
|
|
|
|
- system("ppmrelief junk2$$.ppm >junk2r$$.ppm");
|
|
|
|
+ system("ppmrelief $tmpdir/junk2$$.ppm >$tmpdir/junk2r$$.ppm");
|
|
|
|
}
|
|
|
|
} elsif ($mode eq $OIL) {
|
|
|
|
if ($i == 1) {
|
|
|
|
- system("ppmtopgm junk1$$.ppm | pgmoil >junko$$.ppm");
|
|
|
|
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
|
|
|
|
- ">junk1o$$.ppm");
|
|
|
|
+ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmoil >$tmpdir/junko$$.ppm");
|
|
|
|
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
|
|
|
|
+ ">$tmpdir/junk1o$$.ppm");
|
|
|
|
}
|
|
|
|
if ($i <= 10) {
|
|
|
|
my $n = $spline10[$i];
|
|
|
|
- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} elsif ($i <= 20) {
|
|
|
|
my $n = $spline10[$i-10];
|
|
|
|
- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} else {
|
|
|
|
my $n = $spline10[$i-20];
|
|
|
|
- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
}
|
|
|
|
if ($i == 10) {
|
|
|
|
- system("ppmtopgm junk2$$.ppm | pgmoil >junko$$.ppm");
|
|
|
|
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
|
|
|
|
- ">junk2o$$.ppm");
|
|
|
|
+ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmoil >$tmpdir/junko$$.ppm");
|
|
|
|
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
|
|
|
|
+ ">$tmpdir/junk2o$$.ppm");
|
|
|
|
}
|
|
|
|
} elsif ($mode eq $EDGE) {
|
|
|
|
if ($i == 1) {
|
|
|
|
- system("ppmtopgm junk1$$.ppm | pgmedge >junko$$.ppm");
|
|
|
|
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
|
|
|
|
- ">junk1o$$.ppm");
|
|
|
|
+ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmedge >$tmpdir/junko$$.ppm");
|
|
|
|
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
|
|
|
|
+ ">$tmpdir/junk1o$$.ppm");
|
|
|
|
}
|
|
|
|
if ($i <= 10) {
|
|
|
|
my $n = $spline10[$i];
|
|
|
|
- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} elsif ($i <= 20) {
|
|
|
|
my $n = $spline10[$i-10];
|
|
|
|
- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} else {
|
|
|
|
my $n = $spline10[$i-20];
|
|
|
|
- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
}
|
|
|
|
if ($i == 10) {
|
|
|
|
- system("ppmtopgm junk2$$.ppm | pgmedge >junko$$.ppm");
|
|
|
|
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
|
|
|
|
- ">junk2o$$.ppm");
|
|
|
|
+ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmedge >$tmpdir/junko$$.ppm");
|
|
|
|
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
|
|
|
|
+ ">$tmpdir/junk2o$$.ppm");
|
|
|
|
}
|
|
|
|
} elsif ($mode eq $BENTLEY) {
|
|
|
|
if ($i == 1) {
|
|
|
|
- system("ppmtopgm junk1$$.ppm | pgmbentley >junko$$.ppm");
|
|
|
|
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
|
|
|
|
- ">junk1o$$.ppm");
|
|
|
|
+ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmbentley >$tmpdir/junko$$.ppm");
|
|
|
|
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
|
|
|
|
+ ">$tmpdir/junk1o$$.ppm");
|
|
|
|
}
|
|
|
|
if ($i <= 10) {
|
|
|
|
my $n = $spline10[$i];
|
|
|
|
- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} elsif ($i <= 20) {
|
|
|
|
my $n = $spline10[$i-10];
|
|
|
|
- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} else {
|
|
|
|
my $n = $spline10[$i-20];
|
|
|
|
- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
}
|
|
|
|
if ($i == 10) {
|
|
|
|
- system("ppmtopgm junk2$$.ppm | pgmbentley >junko$$.ppm");
|
|
|
|
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
|
|
|
|
- ">junk2o$$.ppm");
|
|
|
|
+ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmbentley >$tmpdir/junko$$.ppm");
|
2005-03-29 14:08:28 +00:00
|
|
|
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
|
2004-09-09 09:17:25 +00:00
|
|
|
+ ">$tmpdir/junk2o$$.ppm");
|
|
|
|
}
|
|
|
|
} elsif ($mode eq $BLOCK) {
|
|
|
|
if ($i <= 10) {
|
|
|
|
my $n = 1 - 1.9*$spline20[$i];
|
2005-03-29 14:08:28 +00:00
|
|
|
- system("pamscale $n junk1$$.ppm | " .
|
|
|
|
- "pamscale -width $width -height $height >junk3$$.ppm");
|
|
|
|
+ system("pamscale $n $tmpdir/junk1$$.ppm | " .
|
|
|
|
+ "pamscale -width $width -height $height >$tmpdir/junk3$$.ppm");
|
2004-09-09 09:17:25 +00:00
|
|
|
} elsif ($i <= 20) {
|
|
|
|
my $n = $spline10[$i-10];
|
|
|
|
- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} else {
|
|
|
|
my $n = 1 - 1.9*$spline20[31-$i];
|
2005-03-29 14:08:28 +00:00
|
|
|
- system("pamscale $n junk2$$.ppm | " .
|
|
|
|
- "pamscale -width $width -height $height >junk3$$.ppm");
|
|
|
|
+ system("pamscale $n $tmpdir/junk2$$.ppm | " .
|
|
|
|
+ "pamscale -width $width -height $height >$tmpdir/junk3$$.ppm");
|
2004-09-09 09:17:25 +00:00
|
|
|
}
|
|
|
|
if ($i == 10) {
|
|
|
|
- system("cp", "junk3$$.ppm", "junk1a$$.ppm");
|
2005-03-29 14:08:28 +00:00
|
|
|
- system("pamscale $n junk2$$.ppm | " .
|
|
|
|
- "pamscale -width $width -height $height >junk2a$$.ppm");
|
2004-09-09 09:17:25 +00:00
|
|
|
+ system("cp", "$tmpdir/junk3$$.ppm", "$tmpdir/junk1a$$.ppm");
|
2005-03-29 14:08:28 +00:00
|
|
|
+ system("pamscale $n $tmpdir/junk2$$.ppm | " .
|
|
|
|
+ "pamscale -width $width -height $height >$tmpdir/junk2a$$.ppm");
|
2004-09-09 09:17:25 +00:00
|
|
|
}
|
|
|
|
} elsif ($mode eq $MIX) {
|
|
|
|
my $fade_factor = sqrt(1/($nframes-$i+1));
|
|
|
|
- system("ppmmix $fade_factor junk1$$.ppm junk2$$.ppm >junk3$$.ppm");
|
|
|
|
+ system("ppmmix $fade_factor $tmpdir/junk1$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
|
|
|
|
} else {
|
|
|
|
print("Internal error: impossible mode value '$mode'\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
my $outfile = sprintf("%s.%04d.ppm", $base_name, $i);
|
|
|
|
- system("cp", "junk3$$.ppm", $outfile);
|
|
|
|
+ system("cp", "$tmpdir/junk3$$.ppm", $outfile);
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Clean up shop.
|
|
|
|
#
|
|
|
|
-system("rm junk*$$.ppm");
|
2005-03-29 14:08:28 +00:00
|
|
|
+system("rm $tmpdir/junk*$$.ppm");
|
2004-09-09 09:17:25 +00:00
|
|
|
|
|
|
|
exit(0);
|
2009-10-21 15:11:20 +00:00
|
|
|
diff -up netpbm-10.47.04/editor/ppmquantall.security2 netpbm-10.47.04/editor/ppmquantall
|
|
|
|
--- netpbm-10.47.04/editor/ppmquantall.security2 2009-10-21 13:38:57.000000000 +0200
|
|
|
|
+++ netpbm-10.47.04/editor/ppmquantall 2009-10-21 14:52:38.000000000 +0200
|
|
|
|
@@ -70,12 +70,8 @@ for i in ${files[@]}; do
|
2005-03-29 14:08:28 +00:00
|
|
|
heights=(${heights[*]} `grep -v '^#' $i | sed '1d; s/.* //; 2q'`)
|
|
|
|
done
|
2004-09-09 09:17:25 +00:00
|
|
|
|
2005-03-29 14:08:28 +00:00
|
|
|
-tempdir="${TMPDIR-/tmp}/ppmquantall.$$"
|
2009-10-21 15:11:20 +00:00
|
|
|
-mkdir -m 0700 $tempdir || \
|
|
|
|
- { echo "Could not create temporary file. Exiting."; exit 1;}
|
2005-03-29 14:08:28 +00:00
|
|
|
-trap 'rm -rf $tempdir' 0 1 3 15
|
|
|
|
-
|
|
|
|
-all=$tempdir/pqa.all.$$
|
|
|
|
+all=$(mktemp -t pqa.all.XXXXXXXXXX) || exit 1
|
|
|
|
+rm -f $all
|
2004-09-09 09:17:25 +00:00
|
|
|
|
2005-03-29 14:08:28 +00:00
|
|
|
pnmcat -topbottom -jleft -white ${files[@]} | pnmquant $newcolors > $all
|
|
|
|
if [ $? != 0 ]; then
|
2009-10-21 15:11:20 +00:00
|
|
|
diff -up netpbm-10.47.04/editor/ppmshadow.security2 netpbm-10.47.04/editor/ppmshadow
|
|
|
|
--- netpbm-10.47.04/editor/ppmshadow.security2 2009-10-21 13:38:57.000000000 +0200
|
|
|
|
+++ netpbm-10.47.04/editor/ppmshadow 2009-10-21 14:51:02.000000000 +0200
|
2005-06-10 09:16:43 +00:00
|
|
|
@@ -72,9 +72,10 @@ sub makeConvolutionKernel($$) {
|
|
|
|
|
2005-03-29 14:08:28 +00:00
|
|
|
|
|
|
|
my $tmpdir = $ENV{TMPDIR} || "/tmp";
|
|
|
|
-my $ourtmp = "$tmpdir/ppmshadow$$";
|
2005-06-10 09:16:43 +00:00
|
|
|
-mkdir($ourtmp, 0777) or
|
2005-03-29 14:08:28 +00:00
|
|
|
- die("Unable to create directory for temporary files '$ourtmp");
|
2008-12-23 20:37:42 +00:00
|
|
|
+my $ourtmp; chomp($ourtmp = `mktemp -d -t PPMshadow.XXXXXX`);
|
2005-03-29 14:08:28 +00:00
|
|
|
+if ($? >> 8) {
|
2005-06-10 09:16:43 +00:00
|
|
|
+ die "Can't create directory for temporary files";
|
2005-03-29 14:08:28 +00:00
|
|
|
+}
|
|
|
|
|
|
|
|
# Process command line options
|
2004-09-09 09:17:25 +00:00
|
|
|
|