libwebp.net
libwebp.net copied to clipboard
Centos 7 Error convert
Libwebp.Net.errors.CommandExecutionException: LibWebP.Net CommandExecutor Shell Failed: An error occurred trying to start process '/tmp/cwebp.sh' with working directory '/var/www/vhosts/xremaps.com/NetCore'. Permission denied
Hello, I encountered the above problem. I will be glad if you help
Centos7 operating system
Hello @detmach can I ask if you resolved the issue? I have the same error on Heroku hosting:
LibWebP.Net CommandExecutor Shell Failed: An error occurred trying to start process '/tmp/cwebp.sh' with working directory '/app/heroku_output'. Permission denied
CC @frankodoom @thekojopatrick
Hi yet to test the library extensively on Linux distros ill fix any bugs and update the library
cwebp.sh.zip Made it work by adding scwep.sh to build output and using this code:
using System.Diagnostics;
string[] path = Directory.GetFiles("/path/to/your/folder");
foreach (string image in path) { string Command = "./cwebp.sh cwebp "+image+" -o "+image; ProcessStartInfo startInfo = new() { CreateNoWindow = true, UseShellExecute = false, FileName = "cwebp.sh", WindowStyle = ProcessWindowStyle.Hidden, Arguments = Command }; try { Process cwebp = Process.Start(startInfo); try { await cwebp.WaitForExitAsync(); if (!cwebp.HasExited) cwebp.Kill(); } finally { cwebp?.Dispose(); } } catch (Exception ex) { Console.WriteLine("LibWebP.Net CommandExecutor Shell Failed: " + ex.Message, ex.InnerException); } }