用phantomjs和php加快图像生成过程
因此,我有这个本地脚本generate.php
它可以通过我的本地主机上的某些特殊文件夹结构进行循环,并使用php exec
函数执行phantomjs脚本以生成缩略图(1200x800 )对于这些项目(这些只是网站/php/html)。
问题是,它真的很慢。我有大约18个不同的图像要生成,只需要30秒到一分钟,只有18张,这不是我想要的。是否有一个选项可以与PHP同时运行18 exec
S,或者可能有一个可以一次处理许多图像的Phantomjs脚本。希望有人有一个主意。
foreach(folder level 1)
foreach(folder level 2)
exec(phantomjs render image)
So I have this local script generate.php
that loops through some special folder structure of websites on my localhost and executes a phantomJS script using the PHP exec
function to generate Thumbnails (1200x800) for these projects (These are just websites/php/html).
The problem is, that its really slow. I have about 18 different images to be generated and it takes from 30sec up to a minute for only those 18 which is not what I want. Is there an option to run those 18 exec
s concurrently with php or maybe there is a phantomJS script that can handle many images at once. Hope someone has an idea.
foreach(folder level 1)
foreach(folder level 2)
exec(phantomjs render image)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论