gpt4 book ai didi

javascript - 精细 uploader : Track Scaled Images ClientSide

转载 作者:行者123 更新时间:2023-11-28 08:11:21 26 4
gpt4 key购买 nike

我们使用 FineUploader 将文件上传到 REST 服务。当前版本的 FineUploader 允许自动上传缩放图像 as detailed here .

FineUploader 有方法在服务器端跟踪与其原始图像相关的缩放图像。成功上传图片后,我们如何在客户端跟踪缩放后的图片?

  • 让服务器确定什么是/不是缩放图像不是一种选择,这一切都必须在客户端上处理。
  • FineUploader 允许将文本附加到缩放文件名的末尾,但我不想使用字符串匹配作为确定图像是否缩放的机制。

最佳答案

Fine Uploader 不提供通过 API 访问缩放图像 Blob 的权限,而仅提供原始文件的访问权限。 scaling feature documentation page 中描述了其原因。 :

Calls to the getFile API method will return the associated original file, not the scaled version. This is due to the fact that, again, the scaled version is not kept around any longer than necessary to conserve memory. Also, generating a scaled version is an asynchronous operation, which would require the getFile API method return a promise, introducing a breaking change to the API.

如果您想自己管理文件的缩放版本,您可以关闭自动缩放功能并通过 scaleImage API method 自行生成缩放版本。 。以这种方式生成的缩放版本可以通过 addBlobs API method 提交上传。也是如此。

关于javascript - 精细 uploader : Track Scaled Images ClientSide,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24173168/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com