Julia71 / projekktor-zwei

Automatically exported from code.google.com/p/projekktor-zwei
0 stars 0 forks source link

Certain filenames cause trouble with poster frames and video sources #56

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
==What steps will reproduce the problem?==
1. Set a file titled like this as the poster frame: foo_bar_jpg_23.jpg 
or 2. Same applies for any source declaration containing a file extension known 
to projekktor (i.e. mp4, jpg, png)

==What is the expected output? What do you see instead?==
Projekktor shows a message saying `Sorry, your browser does not support the 
media format of the requested clip. `

==Why does it happen?==
The bug happens in the `_prepareMedia` function. The reg-ex for determining the 
file extension is escaped improperly.

`.jpg|.png|.mp4`... also matches to file extensions inside the filename even 
without a leading dot.

==How to fix it==
I see now that you already started fixing it for release 0.80. Nevertheless the 
new code would still fail for filenames having multiple dots, as you are 
checking only for the first match of the regular expression.
I suggest a regular expression like `.jpg&|.png&|.mp4&`... that checks only 
matches the extension at the end of a string.

Original issue reported on code.google.com by allesbli...@googlemail.com on 19 Oct 2010 at 8:14

GoogleCodeExporter commented 8 years ago
groovy!

Original comment by frankygh...@googlemail.com on 19 Oct 2010 at 9:08

GoogleCodeExporter commented 8 years ago

Original comment by frankygh...@googlemail.com on 30 Oct 2010 at 10:49