summaryrefslogtreecommitdiff
path: root/PLUGINS/src/pictures
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2008-02-02 11:34:43 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2008-02-02 11:34:43 +0100
commit538cbdb26a7804408c368804def0dce0dc4821c9 (patch)
tree1d4ea498a47fede890172d572df562d8bb598d26 /PLUGINS/src/pictures
parent317240e970b8addd96764f611e7b7fa06c1a2ec8 (diff)
downloadvdr-538cbdb26a7804408c368804def0dce0dc4821c9.tar.gz
vdr-538cbdb26a7804408c368804def0dce0dc4821c9.tar.bz2
Added option -i to the pictures plugin's pic2mpg to ignore unknown file types
Diffstat (limited to 'PLUGINS/src/pictures')
-rw-r--r--PLUGINS/src/pictures/HISTORY4
-rwxr-xr-xPLUGINS/src/pictures/pic2mpg13
-rw-r--r--PLUGINS/src/pictures/pictures.c4
3 files changed, 15 insertions, 6 deletions
diff --git a/PLUGINS/src/pictures/HISTORY b/PLUGINS/src/pictures/HISTORY
index a951ab4d..23725d6d 100644
--- a/PLUGINS/src/pictures/HISTORY
+++ b/PLUGINS/src/pictures/HISTORY
@@ -14,3 +14,7 @@ VDR Plugin 'pictures' Revision History
2008-01-27: Version 0.0.3
- Added French texts (thanks to Patrice Staudt <patrice.staudt@laposte.net>).
+
+2008-02-02: Version 0.0.4
+
+- Added option -i to pic2mpg to ignore unknown file types.
diff --git a/PLUGINS/src/pictures/pic2mpg b/PLUGINS/src/pictures/pic2mpg
index c62dee92..6cd74359 100755
--- a/PLUGINS/src/pictures/pic2mpg
+++ b/PLUGINS/src/pictures/pic2mpg
@@ -7,7 +7,7 @@
#
# See the README file for copyright information and how to reach the author.
#
-# $Id: pic2mpg 1.1 2008/01/13 11:39:12 kls Exp $
+# $Id: pic2mpg 1.2 2008/02/02 11:34:43 kls Exp $
## TODO implement HDTV (1920 x 1080)
@@ -20,20 +20,22 @@ Usage: $0 [options] picture-dir mpeg-dir
$0 [options] picture-file mpeg-file
Options: -a Aspect ratio 4:3 (default is 16:9)
- -h print Help
-f Force conversion
+ -h print Help
+ -i Ignore unknown file types
-n NTSC (default is PAL)
-v num Verbose (0=none, 1=list files, 2=detailed)
-x percent X overscan in percent
-y percent Y overscan in percent
};
-getopts("ahfnv:x:y:") || die $Usage;
+getopts("afhinv:x:y:") || die $Usage;
die $Usage if $opt_h;
$Aspect = $opt_a;
$Force = $opt_f;
+$Ignore = $opt_i;
$NTSC = $opt_n;
$Verbose = $opt_v;
$OverscanX = $opt_x;
@@ -142,7 +144,10 @@ sub ConvertFile
{
my ($Pict, $Mpeg) = @_;
(my $Type) = $Pict =~ /\.([^\.]*)$/;
- die "unknown file type '$Type': '$Pict'\n" unless defined $PNMCONV{$Type};
+ if (!defined $PNMCONV{$Type}) {
+ return if ($Ignore);
+ die "unknown file type '$Type': '$Pict'\n";
+ }
my ($w, $h) = imgsize($Pict);
print "image size is $w x $h\n" if ($Detailed);
if ($w / $h <= $ScreenRatio) {
diff --git a/PLUGINS/src/pictures/pictures.c b/PLUGINS/src/pictures/pictures.c
index ec568cbb..26baf478 100644
--- a/PLUGINS/src/pictures/pictures.c
+++ b/PLUGINS/src/pictures/pictures.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: pictures.c 1.3 2008/01/27 15:44:58 kls Exp $
+ * $Id: pictures.c 1.4 2008/02/02 11:32:50 kls Exp $
*/
#include <getopt.h>
@@ -11,7 +11,7 @@
#include "menu.h"
#include "player.h"
-static const char *VERSION = "0.0.3";
+static const char *VERSION = "0.0.4";
static const char *DESCRIPTION = trNOOP("A simple picture viewer");
static const char *MAINMENUENTRY = trNOOP("Pictures");