Package: netpbm
Version: 2:10.0-12
Severity: wishlist
Tags: patch

Please ship imagetops script which was formerly a part of kdelibs4c2a
package, but now isn't provided by any package (and it is not really
belong to KDE, as it's no KDE-specific).

This would lead to additional dependency on 'file' and, possibly, the
package must conflict with kdelibs4c2a (but I'm not sure about this).

The slightly modified version (just to fix a bug) altogether with its
manpage is attached.

-- System Information:
Debian Release: wheezy/sid
  APT prefers sid
  APT policy: (500, 'sid'), (500, 'oldstable'), (500, 'unstable'), (500, 
'testing'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.38-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages netpbm depends on:
ii  libc6                  2.11.2-2          Embedded GNU C Library: Shared lib
ii  libjpeg62              6b1-1             The Independent JPEG Group's JPEG 
ii  libnetpbm10            2:10.0-12         Shared libraries for netpbm
ii  libpng12-0             1.2.37-1          PNG library - runtime
ii  libtiff4               3.8.2-11          Tag Image File Format (TIFF) libra
ii  zlib1g                 1:1.2.3.3.dfsg-14 compression library - runtime

Versions of packages netpbm recommends:
ii  ghostscript-x [gs]          8.71~dfsg2-6 The GPL Ghostscript PostScript/PDF

netpbm suggests no packages.

-- no debconf information
#!/bin/sh

# extract file name and arguments from command line. File name
# is supposed to be the last one, if it doesn't exist, then it
# is assumed to be another argument.
FILE=
ARGS=
GRAYSCALE=
for arg in "$@"; do
	if [ "$arg" = "-gray" ]; then
		GRAYSCALE=1
	else
		ARGS="$ARGS $FILE"
		FILE=$arg;
	fi
done

# we're reading from STDIN, store it into a temporary file
temp=0
if test -z "$FILE" -o ! -f "$FILE" ; then
	ARGS="$ARGS $FILE"
	FILE=`mktemp --tmpdir imagetops.XXXXXX` || exit 1
	cat > "$FILE"
	temp=1
fi

# check the file mime type, and set the command correspondingly
cmd=
magic=`file -bi "$FILE"`
magicbase=`echo $magic | cut -f 1 -d "/"`
magictype=`echo $magic | cut -f 2- -d "/" | cut -f 1 -d ";"`
if test "$magicbase" != "image" ; then
	echo "Not an image"
	exit 1;
fi
case $magictype in
	jpeg)
		cmd="jpegtopnm"
		;;
	png|x-png)
		cmd="pngtopnm"
		;;
	bmp|x-bmp)
		cmd="bmptoppm"
		;;
	gif)
		cmd="giftopnm"
		;;
	tiff)
		cmd="tifftopnm"
		;;
	*)
		echo "Unsupported image type: $magic"
		exit 1
		;;

esac

# executing command
if [ "$GRAYSCALE" = "1" ]; then
	exec $cmd "$FILE" | ppmtopgm | pnmtops $ARGS
else
	exec $cmd "$FILE" | pnmtops $ARGS
fi

# removing temporary file
if test "$temp" = "1"; then
	rm -f "$FILE"
fi
..TH IMAGETOPS 1 "Jun 2006" "K Desktop Environment" "Generic Image to PS Filter"
..SH NAME
imagetops
\- generic image to ps filter
..SH SYNOPSIS
..BR imagetops \ [ \-gray ]\ [ arguments\ for\ pnmtops ]
..RI [  filename ]
..SH DESCRIPTION
\fBimagetops\fP is a generic image to ps filter. It can be used as print filter in KDE.
..sp 1
\fBimagetops\fP works in two steps:
..IP "    1."
the given file is converted to PNM format by analyzing the file format and calling the appropriate conversion program.
..IP "    2."
the file in PNM format is converted to PS format by calling \fBpnmtops\fP.
..PP
The supported mime types are: jpeg, png, x\-png, bmp, x\-bmp, gif and tiff.
..sp 1
\fBimagetops\fP supports reading the parameters via stdin. A temporary file in \fI$TMPDIR\fP (or \fI/tmp\fP if unset) is created then.
..SH OPTIONS
..SS Options:
..TP
..B  \-gray
convert image to grayscale
..SS Arguments:
..TP
..B arguments for pnmtops
arguments passed to pnmtops
..TP
..I filename
image file to convert
..SH SEE ALSO
..BR bmptoppm (1),\  giftopnm (1),\  jpegtopnm (1),\  pngtopnm (1),\  ppmtopgm (1),\  
..BR pnmtops (1)
..SH AUTHORS
..nf
The KDE project
..br

..br
..fi
Please use http://bugs.kde.org to report bugs.
..PP
This manual page was written by Holger Hartmann <holger_hartm...@gmx.de> for the \fBDebian\fP Project (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation.
..PP
On \fBDebian\fP systems, the complete text of the GNU General Public License can be found in /usr/share/common\-licenses/GPL.

Reply via email to