philipjscott / simple-thumbnail

A library that produces thumbnails from images, videos and URLs :mag_right:
https://www.npmjs.com/package/simple-thumbnail
MIT License
25 stars 14 forks source link

"path" argument for FFMPEG does not support paths with spaces on Win10 #64

Closed uplusion23 closed 4 years ago

uplusion23 commented 4 years ago

Describe the bug When the path for FFMPEG [using ffmpeg-static] has a space in the file path, thumbnail generation fails.

const simple-thumbnail = require('simple-thumbnail')
const ffmpeg = require('ffmpeg-static');

genThumbnail('vid.mp4', 'vid.png', '250x?', { path: ffmpeg }).then(() => console.log('done!')).catch(err => console.error(err))

Environment:

Additional context Here is a snip of the error, with personal information truncated.

C:\Users\{username}\Desktop\Path With Spaces\node_modules\ffmpeg-static\bin\win32\x64\ffmpeg.exe
Error: ffmpeg exited 1
ffmpeg stderr:

'C:\Users\{username}\Desktop\Path' is not recognized as an internal or external command,
operable program or batch file.

    at ChildProcess.<anonymous> (C:\Users\{username}\Desktop\Outlook Test\node_modules\simple-thumbnail\index.js:101:21)
    at ChildProcess.emit (events.js:223:5)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
Ambyjkl commented 4 years ago

:rofl: philip dude fix your newbie mistakes

philipjscott commented 4 years ago

Hi @uplusion23, I'll try to fix this tonight. Thanks for making the issue :smile:

uplusion23 commented 4 years ago

Hi @uplusion23, I'll try to fix this tonight. Thanks for making the issue 😄

No problem! Thanks for the simple plugin. Good work! Fixed it on my end, but my knowledge of Git is not good enough to make a commit request.

philipjscott commented 4 years ago

@uplusion23 Can you please confirm the fix works on your end?

uplusion23 commented 4 years ago

@uplusion23 Can you please confirm the fix works on your end?

Hey! Sorry for the delay, working with a few K/s where I am. My end seemed to work fine after installing the new version!