WinFF / winff

Automatically exported from code.google.com/p/winff
213 stars 50 forks source link

Input and output paths are identical, they are deleted or overwritten with the original video. #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Add /PATH/TO/hoge.avi
2. select output encode. Convert To...: "AVI", Output Folder: "/PATH/TO"
3. Preview click
4. File '/PATH/TO/hoge.avi' already exists. Overwrite ? [y/N] n
5. Preview original video
6. /PATH/TO/hoge.avi original video deleted. Unhappy.
or
4. File '/PATH/TO/hoge.avi' already exists. Overwrite ? [y/N] y
5. Start ffmpeg encode, and original video overwritten. and of course ffmpeg 
freezing.

winff:ver.1.3.1
os:Ubuntu 10.04 Lucid amd64

As a countermeasure. To complete, and encoding files in the preview, a 
temporary file name. Or "the same output file name" to pop up a warning dialog.

Thanks for reading.

Original issue reported on code.google.com by tdms.m...@gmail.com on 16 Feb 2011 at 10:53

GoogleCodeExporter commented 9 years ago
"4. File '/PATH/TO/hoge.avi' already exists. Overwrite ? [y/N] y"

do not choose to overwrite the file.

You should never use the same input and output paths for any program.

Original comment by bgg...@gmail.com on 16 Feb 2011 at 4:53

GoogleCodeExporter commented 9 years ago
The questions "no" and "yes" answer even if both the original file is lost.
I think this is a problem.

>4. File '/PATH/TO/hoge.avi' already exists. Overwrite ? [y/N] n
>5. Preview original video
>6. /PATH/TO/hoge.avi original video deleted. Unhappy.

The preview process, I think measures should be.
The questions "no" answer, but that with the original files are lost.
I think the preview file name appropriate to a temporary file name.

What do you think?

Original comment by tdms.m...@gmail.com on 16 Feb 2011 at 5:12

GoogleCodeExporter commented 9 years ago
just make the destination different

Original comment by bgg...@gmail.com on 16 Feb 2011 at 5:41

GoogleCodeExporter commented 9 years ago
Matt, no offence, but I think the OP is just asking us to protect him/her from 
doing just that, choosing the same output folder as the input. In principle, 
this check should not be very difficult.

If YOU don't want to accept this as a valid request, I might consider if I can 
come up with something, although fpc is not yet my language.

Original comment by poipodec...@hotmail.com on 16 Feb 2011 at 6:47

GoogleCodeExporter commented 9 years ago
I fixed the preview process. I'm happy this fix.

# Thank you. This software has helped us very much.

Original comment by tdms.m...@gmail.com on 16 Feb 2011 at 7:26

Attachments:

GoogleCodeExporter commented 9 years ago
First, I agree, the preview file should really be a temporary file which can be 
safely removed. I have an idea on how to achieve that and will report back with 
that.

Further I have some progress on this bug to warn the user he is doing something 
dangerous. Therefore I added the following to the TfrmMain.btnConvertClick 
procedure, in the "build batch file" part. However, instead of showmessage, I 
need a real window with the option to overrule the warning. The warning pops up 
when I want it, but then I am lost how to do that.

// Test to prevent overwriting source files accidentely (ffmpeg Warns,
// but who cares about that). Fixes bug 110
if (ExpandFileName(destfolder.Text) = ExpandFileName(ExtractFileDir(filename))) 
then
  begin
  showmessage('The source and destination directory are the same. Proceed with caution.') ;
  script.Clear ;
  break ;
end;

Original comment by poipodec...@hotmail.com on 29 May 2011 at 7:10

GoogleCodeExporter commented 9 years ago
Inspired by your patch I created the code I just committed to the svn version 
of winff in revision 535. This solves the problem that the wrong file is 
deleted when previewing.

Matt, I still could use some help with the warning as I mentioned in my 
previous comment.

Original comment by poipodec...@hotmail.com on 29 May 2011 at 8:18

GoogleCodeExporter commented 9 years ago
I will look at here this week

Original comment by bgg...@gmail.com on 7 Jun 2011 at 12:39