hellokaton / webp-io

🌚 general format images and webp transform each other
Apache License 2.0
44 stars 18 forks source link

Failed to create webp image from source file with name contains space #4

Closed majaode closed 2 years ago

majaode commented 5 years ago

OS: MacOS Mojave JDK: 1.8

Success:

Execute: cwebp_tmp/cwebp /var/folders/h5/6_y8qwz13p5g7_3kpx8pj7w80000gn/T/2f20a38e14984d4e974c9a22a49b0e33_Screen_Shot_2019-09-21_at_12.08.32.thumb.630x360.png -o /var/folders/h5/6_y8qwz13p5g7_3kpx8pj7w80000gn/T/2f20a38e14984d4e974c9a22a49b0e33_Screen_Shot_2019-09-21_at_12.08.32.thumb.630x360.webp

Failed:

Execute: cwebp_tmp/cwebp /var/folders/h5/6_y8qwz13p5g7_3kpx8pj7w80000gn/T/33d04bd1d3474e9299a9e530a51d4229_Screen Shot 2019-09-21 at 12.08.32.thumb.630x360.png -o /var/folders/h5/6_y8qwz13p5g7_3kpx8pj7w80000gn/T/33d04bd1d3474e9299a9e530a51d4229_Screen Shot 2019-09-21 at 12.08.32.thumb.630x360.webp
blackr1234 commented 4 years ago

I encounter this issue as well. Then I find it actually unnecessary to use this library because basically it just copies the binaries to the project folder and runs the cwebp.exe command.

Now I'm using the binary I have downloaded directly from Google official website for WebP and with ProcessBuilder it works really well. Glad to see that your pull request is using ProcessBuilder too as it's the right way to handle file names with spaces, which will be equivalent to adding double quotes when executing the command in Command Prompt. It's a shame that the author didn't know ProcessBuilder.

KishorJena commented 2 years ago

I encounter this issue as well. Then I find it actually unnecessary to use this library because basically it just copies the binaries to the project folder and runs the cwebp.exe command.

Now I'm using the binary I have downloaded directly from Google official website for WebP and with ProcessBuilder it works really well. Glad to see that your pull request is using ProcessBuilder too as it's the right way to handle file names with spaces, which will be equivalent to adding double quotes when executing the command in Command Prompt. It's a shame that the author didn't know ProcessBuilder.

can you explain it how to put those tools and use it. I am working on react native project which require gif to webp converter but confused where to put that binary file called gif2webp and how to access it in java file

KishorJena commented 2 years ago

I encounter this issue as well. Then I find it actually unnecessary to use this library because basically it just copies the binaries to the project folder and runs the cwebp.exe command. Now I'm using the binary I have downloaded directly from Google official website for WebP and with ProcessBuilder it works really well. Glad to see that your pull request is using ProcessBuilder too as it's the right way to handle file names with spaces, which will be equivalent to adding double quotes when executing the command in Command Prompt. It's a shame that the author didn't know ProcessBuilder.

can you explain it how to put those tools and use it. I am working on react native project which require gif to webp converter but confused where to put that binary file called gif2webp and how to access it in java file

Now I understand how it woring. I also read the webp doc by google but I am afraid of wasting time and not achieving the goal right now. I would move further If I see the example. :(