frankodoom / libwebp.net

An asynchronous utility for encoding images to Google's .webp format using lossy and lossless compression algorithms.
http://libwebp.azurewebsites.net/
28 stars 4 forks source link

Centos 7 Error convert #6

Open detmach opened 1 year ago

detmach commented 1 year ago

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

vitvitskyi commented 1 year ago

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

frankodoom commented 1 year ago

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

stany24 commented 3 weeks ago

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