diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-03-29 21:17:12 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-03-29 21:17:12 +0000 |
commit | 0650b25ed6a0123e58c76616fef606fd3f8ad799 (patch) | |
tree | 76f2051a92fc6e93c06d2d4af44bf3f1178c0454 /editor | |
parent | c85e6aae67d557791c2e15992d2df2839a5d0bf6 (diff) | |
download | netpbm-mirror-0650b25ed6a0123e58c76616fef606fd3f8ad799.tar.gz netpbm-mirror-0650b25ed6a0123e58c76616fef606fd3f8ad799.tar.xz netpbm-mirror-0650b25ed6a0123e58c76616fef606fd3f8ad799.zip |
Release 10.47.49
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@2165 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rw-r--r-- | editor/Makefile | 28 | ||||
-rwxr-xr-x | editor/pnmmargin | 2 | ||||
-rw-r--r-- | editor/specialty/Makefile | 4 | ||||
-rw-r--r-- | editor/specialty/pamdeinterlace.c | 8 | ||||
-rw-r--r-- | editor/specialty/ppmrelief.c | 18 |
5 files changed, 36 insertions, 24 deletions
diff --git a/editor/Makefile b/editor/Makefile index bc0f5913..d5d7633f 100644 --- a/editor/Makefile +++ b/editor/Makefile @@ -63,30 +63,30 @@ install.bin.local: $(PKGDIR)/bin # Remember that $(SYMLINK) might just be a copy command. # backward compatibility: program used to be pnminterp cd $(PKGDIR)/bin ; \ - rm -f pnminterp; \ - $(SYMLINK) pamstretch$(EXE) pnminterp + rm -f pnminterp$(EXE); \ + $(SYMLINK) pamstretch$(EXE) pnminterp$(EXE) # In March 2002, pnmnorm replaced ppmnorm and pgmnorm cd $(PKGDIR)/bin ; \ - rm -f ppmnorm ; \ - $(SYMLINK) pnmnorm$(EXE) ppmnorm + rm -f ppmnorm$(EXE) ; \ + $(SYMLINK) pnmnorm$(EXE) ppmnorm$(EXE) cd $(PKGDIR)/bin ; \ - rm -f pgmnorm ; \ - $(SYMLINK) pnmnorm$(EXE) pgmnorm + rm -f pgmnorm$(EXE) ; \ + $(SYMLINK) pnmnorm$(EXE) pgmnorm$(EXE) # In March 2003, pamedge replaced pgmedge cd $(PKGDIR)/bin ; \ - rm -f pgmedge ; \ - $(SYMLINK) pamedge$(EXE) pgmedge + rm -f pgmedge$(EXE) ; \ + $(SYMLINK) pamedge$(EXE) pgmedge$(EXE) # In October 2004, pamenlarge replaced pnmenlarge cd $(PKGDIR)/bin ; \ - rm -f pnmenlarge ; \ - $(SYMLINK) pamenlarge$(EXE) pnmenlarge + rm -f pnmenlarge$(EXE) ; \ + $(SYMLINK) pamenlarge$(EXE) pnmenlarge$(EXE) # In March 2009, pamcut replaced pnmcut (but pamcut is much older -- pnmcut # was obsoleted by pamcut long before this). cd $(PKGDIR)/bin ; \ - rm -f pnmcut ; \ - $(SYMLINK) pamcut$(EXE) pnmcut + rm -f pnmcut$(EXE) ; \ + $(SYMLINK) pamcut$(EXE) pnmcut$(EXE) # In March 2009, pamscale replaced pnmscale (but pamscale is much older -- # pnmscale was obsoleted by pamscale long before this). cd $(PKGDIR)/bin ; \ - rm -f pnmscale ; \ - $(SYMLINK) pamscale$(EXE) pnmscale + rm -f pnmscale$(EXE) ; \ + $(SYMLINK) pamscale$(EXE) pnmscale$(EXE) diff --git a/editor/pnmmargin b/editor/pnmmargin index 51ebebe5..b31deefd 100755 --- a/editor/pnmmargin +++ b/editor/pnmmargin @@ -76,7 +76,7 @@ fi cat $@ > $tmp1 -if [ $size == 0 ] ; then +if [ $size -eq 0 ] ; then # Zero margin; just copy input to output pamtopnm $plainopt $tmp1; else diff --git a/editor/specialty/Makefile b/editor/specialty/Makefile index eda54882..76befbb4 100644 --- a/editor/specialty/Makefile +++ b/editor/specialty/Makefile @@ -51,5 +51,5 @@ install.bin.local: $(PKGDIR)/bin # Remember that $(SYMLINK) might just be a copy command. # pamoil replaced pgmoil in June 2001. cd $(PKGDIR)/bin ; \ - rm -f pgmoil ; \ - $(SYMLINK) pamoil$(EXE) pgmoil + rm -f pgmoil$(EXE) ; \ + $(SYMLINK) pamoil$(EXE) pgmoil$(EXE) diff --git a/editor/specialty/pamdeinterlace.c b/editor/specialty/pamdeinterlace.c index f158fbac..7c6b123c 100644 --- a/editor/specialty/pamdeinterlace.c +++ b/editor/specialty/pamdeinterlace.c @@ -32,7 +32,7 @@ parseCommandLine(int argc, char ** argv, was passed to us as the argv array. -----------------------------------------------------------------------------*/ optStruct3 opt; /* set by OPTENT3 */ - optEntry *option_def; + optEntry * option_def; unsigned int option_def_index; unsigned int takeeven, takeodd; @@ -50,6 +50,8 @@ parseCommandLine(int argc, char ** argv, optParseOptions3(&argc, argv, opt, sizeof(opt), 0); /* Uses and sets argc, argv, and some of *cmdlineP and others. */ + free(option_def); + if (takeeven && takeodd) pm_error("You cannot specify both -takeeven and -takeodd options."); @@ -90,6 +92,10 @@ main(int argc, char *argv[]) { pnm_readpaminit(ifP, &inpam, PAM_STRUCT_SIZE(tuple_type)); + if (inpam.height < 2 && cmdline.rowsToTake == ODD) + pm_error("You requested to take the odd rows, but there aren't " + "any odd rows in the image - it has only one row - Row 0"); + tuplerow = pnm_allocpamrow(&inpam); outpam = inpam; /* Initial value -- most fields should be same */ diff --git a/editor/specialty/ppmrelief.c b/editor/specialty/ppmrelief.c index 5e0669c3..1c408aec 100644 --- a/editor/specialty/ppmrelief.c +++ b/editor/specialty/ppmrelief.c @@ -11,6 +11,7 @@ */ #include <stdio.h> +#include "pm_c_util.h" #include "ppm.h" int @@ -38,6 +39,11 @@ main(int argc, char * argv[]) { pm_usage( usage ); ppm_readppminit( ifp, &cols, &rows, &maxval, &format ); + + if (cols < 3 || rows < 3 ) + pm_error("Input image too small: %u x %u. Must be at least 3x3", + cols, rows); + mv2 = maxval / 2; /* Allocate space for 3 input rows, plus an output row. */ @@ -67,12 +73,12 @@ main(int argc, char * argv[]) { ppm_readppmrow( ifp, inputbuf[rowa], cols, maxval, format ); for ( col = 0; col < cols - 2; ++col ) { - r = PPM_GETR( inputbuf[rowa][col] ) + - ( mv2 - PPM_GETR( inputbuf[rowb][col + 2] ) ); - g = PPM_GETG( inputbuf[rowa][col] ) + - ( mv2 - PPM_GETG( inputbuf[rowb][col + 2] ) ); - b = PPM_GETB( inputbuf[rowa][col] ) + - ( mv2 - PPM_GETB( inputbuf[rowb][col + 2] ) ); + r = MAX(0, MIN(maxval, PPM_GETR( inputbuf[rowa][col] ) + + ( mv2 - PPM_GETR( inputbuf[rowb][col + 2] ) ))); + g = MAX(0, MIN(maxval, PPM_GETG( inputbuf[rowa][col] ) + + ( mv2 - PPM_GETG( inputbuf[rowb][col + 2] ) ))); + b = MAX(0, MIN(maxval, PPM_GETB( inputbuf[rowa][col] ) + + ( mv2 - PPM_GETB( inputbuf[rowb][col + 2] ) ))); PPM_ASSIGN( outputrow[col + 1], r, g, b ); } ppm_writeppmrow( stdout, outputrow, cols, maxval, 0 ); |