Open rosell-dk opened 5 years ago
Binary version will always be superior to PHP's one, because of native instructions I highly doubt someone would need pure js/php solution for this in production
True, binary version will be much faster. However, speed isn't so important because each image only needs to be converted once. Availability is much more important. If none of the binary alternatives are available on some shared host, well, they aren't really alternatives. A converter in pure PHP will on the other side work on all platforms. This is valuable, especially for smaller sites run on shared hosts managed by non-tech people who just want things to work out of the box. Wordpress springs to mind.
@StarveTheEgo it's not completely a bad idea cause the next major php version will possibly include JIT which will improve CPU intensive tasks
It is expected to make most CPU-intensive workloads run significantly faster.
It seems there is a copyright issue to deal with
WebP conversion is available in javascript.
There is libwebpjs And there is this demo, where libwebp has been compiled into javascript with emscripten.
Amazing!
But we need it in PHP. Is there any Javascript to PHP compiler out there? Yes, it seems so!: http://endel.me/js2php/