简体   繁体   English

imageresize后如何获取imagick临时文件的名称

[英]how can i get the name of imagick temp file after imageresize

Using imagemagick, I need to resize images of multiple sizes (800px, 400px, 50px). 使用imagemagick,我需要调整多种尺寸(800像素,400像素,50像素)的图像的大小。

And I do not want to save these image locally because I need to upload the image to Amazon S3 anyways. 而且我不想在本地保存这些图像,因为无论如何我都需要将图像上传到Amazon S3。

For example, after the following code 例如,下面的代码

$im->resizeImage(0, 800, imagick::FILTER_LANCZOS, 1, FALSE);

$im->getImageFilename() still returns the original temp file uploaded prior to resizing. $ im-> getImageFilename()仍返回在调整大小之前上载的原始临时文件。 What I need is the temp file name & path after the resizing so that I can upload it straight to Amazon S3 without doing writeImage() locally. 我需要的是调整大小后的临时文件名和路径,这样我就可以将其直接上传到Amazon S3,而无需在本地执行writeImage()。 To save time and space. 节省时间和空间。

Any suggestion? 有什么建议吗?

There is no "temp file". 没有“临时文件”。 ImageMagick does operations in memory. ImageMagick在内存中执行操作。 If you want the image to be written out to a file you need to call $im->writeImage . 如果要将图像写出到文件中,则需要调用$im->writeImage

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM