mlange-42 / chrono-photo

Chronophotography command line tool and library in Rust.

Home Page:https://mlange-42.github.io/chrono-photo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to create output directory, if output has no directory

bokepa opened this issue · comments

On OSX (not tested in Windows), crashes if output contains no dir path.
Some versions before it has no problem with it:


./chrono-photo --pattern "test_data/generated/image-000*.jpg" --output test.jpg

Temp directory: "/var/folders/bd/4nwq6clx0px9w6t5kgj70gl00000gn/T/chrono-photo"
Time-slicing 25 images
Total: 27742 kb in 192 files
Processing 192 time slices
Saving output... 
thread 'main' panicked at 'Unable to create output directory "": Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:542:9

Instead, putting --output ./test.jpg works, but it's not very common. Also works OK puttin a dirname, because create it.
Problem is somewhere before create outputdir, should check if parent is empty or something like that.

The problem here was probably introduced when I added a check like out.parent().is_dir() to create the output directory in case it does not exist.

I should probably convert to an absolute path before...

As a side not: non-existant directories are only created one level deep, for "security".

Thanks, @bokepa !

Solved in 40b834c (version 0.6.3)

@bokepa Not related to this issue, but don't know how to contact you otherwise...

I am trying to set up automatic releases via Travis. However, I am not sure what file(s) are the OSX executables, as they have no extension, just the plain file name.

I have a test repo for that. Could you please test if the build works for you (should just print "Hello world!")?
https://github.com/mlange-42/travis-test/releases/tag/0.1.8

Many thanks in advance!

Released 0.6.5 with travis? I've downloaded it and it works ok.

@bokepa Yes, exactly. Cool!
Many thanks!

I started another photo-tool, in case it is of interest for you:
https://github.com/mlange-42/print-prep