[英]What is more efficiente resize an image and the convert to base64 or convert to base64 and then resize it? (node.js - no canvas)
I have a local set of files that have to resize and then convert yo base64 (in the server side, using nodejs and without canvas support).我有一组本地文件,必须调整大小然后转换 yo base64(在服务器端,使用 nodejs 并且不支持 canvas)。 I wonder with approach is more eficient (fast and less RAM consuming):我想知道这种方法更有效(快速且消耗更少的 RAM):
Or:或者:
Thank you!谢谢!
As it's have been commented: even if a image processing lib allows you to pass a base64 encoded version of an image and work on it directly, behind the scenes it will always decode the base64 into an image format, do the processing (resize) and then probably encode it again, so starting with b64 is certainly slower.正如已经评论的那样:即使图像处理库允许您传递图像的 base64 编码版本并直接对其进行处理,在幕后它总是将 base64 解码为图像格式,进行处理(调整大小)和然后可能会再次对其进行编码,因此从 b64 开始肯定会更慢。
Answering the original question - in terms of fast and efficiency is better:回答原始问题 - 就快速和效率而言更好:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.