libwebp.net icon indicating copy to clipboard operation
libwebp.net copied to clipboard

Centos 7 Error convert

Open detmach opened this issue 2 years ago • 3 comments

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

detmach avatar Nov 05 '22 21:11 detmach

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

vitvitskyi avatar Jan 13 '23 14:01 vitvitskyi

Hi yet to test the library extensively on Linux distros ill fix any bugs and update the library

frankodoom avatar Feb 21 '23 09:02 frankodoom

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); } }

stany24 avatar Sep 06 '24 16:09 stany24