擅长:python、mysql、java
<p>生成缩略图有三种基本方法(可能更多!)。在</p>
<p><strong>在别处生成</strong></p>
<p>上传原始文件时只需上传一个附加文件。缩略图需要在系统外部生成。在</p>
<p><strong>使用AWS Lambda函数生成缩略图</strong></p>
<p>当图像上传到amazons3时,它可以生成一个运行AWS Lambda函数的事件。然后Lambda函数可以创建一个新的、调整大小的图像。在</p>
<p>有关示例,请参见:<a href="https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html" rel="nofollow noreferrer">Tutorial: Using AWS Lambda with Amazon S3 - AWS Lambda</a></p>
<p><strong>使用外部服务</strong></p>
<p>与其存储缩略图,不如使用外部服务动态生成缩略图。一些此类服务包括:</p>
<ul>
<li><a href="http://cloudinary.com/" rel="nofollow noreferrer">Cloudinary</a></li>
<li><a href="http://imgix.com/" rel="nofollow noreferrer">Imgix</a></li>
</ul>