Fix for issue #1

I don't know all use cases of this particular trimming, but at least stripping not output directory, but input directory from filename made the output filename correct in my case.
Merge pull request #4 from hijarian/patch-1

Fix for issue #1