elixir-mogrify / mogrify

Image processing in Elixir (ImageMagick command line wrapper)
MIT License
570 stars 65 forks source link

File/Directory names with spaces are throwing errors #35

Closed notdevinclark closed 7 years ago

notdevinclark commented 7 years ago

I noticed that when you try and use verbose on an image with spaces in its name, or technically anywhere within its path, that it would throw an error. Like so:

** (MatchError) no match of right hand side value: {"mogrify: unable to open image `/home/username/dir/mogrify/test/fixtures/ben\\': No such file or directory @ error/blob.c/OpenBlob/2712.\nmogrify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.\nmogrify: unable to open image `der.jpg': No such file or directory @ error/blob.c/OpenBlob/2712.\n", 1}

I added a test in the repo where you simply try to call verbose on the @fixture_with_space variable and it fails. I am preparing a PR to fix this.

The issue falls with the ~w() function call, you are passing in the path/file name and substituting spaces with "// " but that does not properly sanitize the string to work with the ~w() function

Will link it here soon. It will also update all functions that use anything that could have a space, also will be updating tests as well.

notdevinclark commented 7 years ago

PR is linked and ready for review. Let me know if you have any questions or suggestions for changes.

talklittle commented 7 years ago

Fixed by #36 for Mogrify v0.5.2