Re: [vdr] vdr-pictures and pic2mpg

2008-03-01 Thread Stefan Wagner
Klaus Schmidinger [EMAIL PROTECTED] wrote:
 On 02/25/08 19:59, Stefan Wagner wrote:
 the script only works with absolute paths correctly.
 
 Please try the attached patch.

now it works fine.
tx for patch

stefan


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] vdr-pictures and pic2mpg

2008-02-29 Thread Klaus Schmidinger
On 02/25/08 19:59, Stefan Wagner wrote:
 Klaus Schmidinger [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED]:/media/daten/burn$ pic2mpg -v 1 /media/daten/burn/ 
 /media/daten/burn/dest/
 ./dscn0015.jpg - /media/daten/burn/dest//./dscn0015.jpg.mpg
 ./DSCN00051.JPG - /media/daten/burn/dest//./DSCN00051.JPG.mpg

 but wen i call the script with relative paths:
 [EMAIL PROTECTED]:/media/daten/burn$ pic2mpg -v 1 ./ dest/
 ./dscn0015.jpg - dest//./dscn0015.jpg.mpg
 ./DSCN00051.JPG - dest//./DSCN00051.JPG.mpg
 removing ./DSCN00051.JPG.mpg
 removing ./dscn0015.jpg.mpg
 dest/: No such file or directory

 why will the script remove the files?
 they are in dest/ before ending script.
 From the README file:

 Just don't make the destination directory a subdirectory of
 the source directory, because this would surely lead to problems.
 
 ok, but with relative paths it don't works.
 
 [EMAIL PROTECTED]:~/tests$ ls
 dest  source
 [EMAIL PROTECTED]:/tmp$ pic2mpg -v 1 source dest
 ./DSCN2155.JPG - dest/./DSCN2155.JPG.mpg
 ./DSCN2154.JPG - dest/./DSCN2154.JPG.mpg
 removing ./DSCN2155.JPG.mpg
 removing ./DSCN2154.JPG.mpg
 dest: Datei oder Verzeichnis nicht gefunden
 
 the script will create a dest dir in source (/tmp/source/dest/) and
 delete the files after finishing.
 
 the script only works with absolute paths correctly.

Please try the attached patch.

Klaus
--- PLUGINS/src/pictures/pic2mpg	2008/02/24 22:00:18	1.3
+++ PLUGINS/src/pictures/pic2mpg	2008/02/29 14:34:22
@@ -12,6 +12,7 @@
 ## TODO implement HDTV (1920 x 1080)
 
 use File::Path;
+use File::Spec;
 use Getopt::Std;
 use Image::Size;
 
@@ -87,8 +88,8 @@
 
 die $0: mixed directory and file ('$ARGV[0]' - '$ARGV[1]')\n unless !-e $ARGV[1] || -d $ARGV[1];
 
-$PICDIR = $ARGV[0];
-$MPGDIR = $ARGV[1];
+$PICDIR = File::Spec-rel2abs($ARGV[0]);
+$MPGDIR = File::Spec-rel2abs($ARGV[1]);
 
 # Convert pictures to mpegs:
 
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] vdr-pictures and pic2mpg

2008-02-25 Thread Stefan Wagner
Klaus Schmidinger [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED]:/media/daten/burn$ pic2mpg -v 1 /media/daten/burn/ 
 /media/daten/burn/dest/
 ./dscn0015.jpg - /media/daten/burn/dest//./dscn0015.jpg.mpg
 ./DSCN00051.JPG - /media/daten/burn/dest//./DSCN00051.JPG.mpg
 
 but wen i call the script with relative paths:
 [EMAIL PROTECTED]:/media/daten/burn$ pic2mpg -v 1 ./ dest/
 ./dscn0015.jpg - dest//./dscn0015.jpg.mpg
 ./DSCN00051.JPG - dest//./DSCN00051.JPG.mpg
 removing ./DSCN00051.JPG.mpg
 removing ./dscn0015.jpg.mpg
 dest/: No such file or directory
 
 why will the script remove the files?
 they are in dest/ before ending script.
 
 From the README file:
 
 Just don't make the destination directory a subdirectory of
 the source directory, because this would surely lead to problems.

ok, but with relative paths it don't works.

[EMAIL PROTECTED]:~/tests$ ls
dest  source
[EMAIL PROTECTED]:/tmp$ pic2mpg -v 1 source dest
./DSCN2155.JPG - dest/./DSCN2155.JPG.mpg
./DSCN2154.JPG - dest/./DSCN2154.JPG.mpg
removing ./DSCN2155.JPG.mpg
removing ./DSCN2154.JPG.mpg
dest: Datei oder Verzeichnis nicht gefunden

the script will create a dest dir in source (/tmp/source/dest/) and
delete the files after finishing.

the script only works with absolute paths correctly.

stefan


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] vdr-pictures and pic2mpg

2008-02-24 Thread Stefan Wagner
the pic2mpg script aceptis only files with lower case caracters.
is it posible to support upper case caracters by default?

my pictures are named DSCN*.JPG and the script only acepts  DSCN*.jpg.

stefan


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] vdr-pictures and pic2mpg

2008-02-24 Thread Klaus Schmidinger
On 02/24/08 21:42, Stefan Wagner wrote:
 the pic2mpg script aceptis only files with lower case caracters.
 is it posible to support upper case caracters by default?
 
 my pictures are named DSCN*.JPG and the script only acepts  DSCN*.jpg.

--- PLUGINS/src/pictures/pic2mpg2008/02/02 11:34:43 1.2
+++ PLUGINS/src/pictures/pic2mpg2008/02/24 22:00:18
@@ -143,7 +143,7 @@
 sub ConvertFile
 {
   my ($Pict, $Mpeg) = @_;
-  (my $Type) = $Pict =~ /\.([^\.]*)$/;
+  (my $Type) = lc($Pict) =~ /\.([^\.]*)$/;
   if (!defined $PNMCONV{$Type}) {
  return if ($Ignore);
  die unknown file type '$Type': '$Pict'\n;


(untested).

Klaus

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] vdr-pictures and pic2mpg

2008-02-24 Thread Stefan Wagner
Klaus Schmidinger [EMAIL PROTECTED] wrote:
 On 02/24/08 21:42, Stefan Wagner wrote:
 the pic2mpg script aceptis only files with lower case caracters.
 is it posible to support upper case caracters by default?
 
 my pictures are named DSCN*.JPG and the script only acepts  DSCN*.jpg.
 
 --- PLUGINS/src/pictures/pic2mpg2008/02/02 11:34:43 1.2
 +++ PLUGINS/src/pictures/pic2mpg2008/02/24 22:00:18
 @@ -143,7 +143,7 @@
 sub ConvertFile
 {
   my ($Pict, $Mpeg) = @_;
 -  (my $Type) = $Pict =~ /\.([^\.]*)$/;
 +  (my $Type) = lc($Pict) =~ /\.([^\.]*)$/;
   if (!defined $PNMCONV{$Type}) {
  return if ($Ignore);
  die unknown file type '$Type': '$Pict'\n;
 
 
 (untested).
 
 Klaus

works fine now with uper and lower case.

[EMAIL PROTECTED]:/media/daten/burn$ pic2mpg -v 1 /media/daten/burn/ 
/media/daten/burn/dest/
./dscn0015.jpg - /media/daten/burn/dest//./dscn0015.jpg.mpg
./DSCN00051.JPG - /media/daten/burn/dest//./DSCN00051.JPG.mpg

but wen i call the script with relative paths:
[EMAIL PROTECTED]:/media/daten/burn$ pic2mpg -v 1 ./ dest/
./dscn0015.jpg - dest//./dscn0015.jpg.mpg
./DSCN00051.JPG - dest//./DSCN00051.JPG.mpg
removing ./DSCN00051.JPG.mpg
removing ./dscn0015.jpg.mpg
dest/: No such file or directory

why will the script remove the files?
they are in dest/ before ending script.

stefan


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr