尝试转换图像时出错 < App Engine 中 1 MB

发布于 2024-08-24 01:38:31 字数 188 浏览 7 评论 0 原文

因此,我知道 App Engine 会阻止处理大小超过 1 MB 的图像,但当我对磁盘上大小为 400K 的 jpg 调用 images.resize 时,会收到 RequestTooLargeError 错误。 jpg 的尺寸为 1600 x 1200,那么应用程序引擎是否无法处理超过 1 兆像素的图像大小调整,即使图像文件本身是小于 1 MB 的压缩格式?

So I know that App Engine prevents working with images greater than 1 MB in size, but I'm getting a RequestTooLargeError when I call images.resize on an jpg that is 400K on disk. The dimensions of the jpg are 1600 x 1200, so is it that app engine can't handle resizing images over 1 megapixel, even if the image file itself is a compressed format that is smaller than 1 MB?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遇到 2024-08-31 01:38:31

这是最好的猜测......不是真正的答案。

根据我在这里和其他一些线程中读到的内容,图像 api 似乎已将您的图像解压缩为大于 1 MB 的形式,然后继续抱怨它创建的图像。

防止这种情况的唯一方法是将原始图像切成不大于 640x520 的块...但这需要在客户端进行一些相当繁重的列表。

补充:此有关图片大小限制的应用引擎问题可能会导致 添加了一些有用的指示

:您可能可以利用在这个问题的初始修订中得到的发现...您说裁剪有效但调整大小没有...这将允许您将大部分处理保留在服务器上 -边。

添加:另一个关于小 JPG 转换为大图像的效果的线程

This a is best guess... not an real answer.

Based on what I have read here and in some other threads, it seems like the image api has decompressed your image into a form that is larger than 1 MB and then proceeded to complain about the image that it created.

About the only way to prevent that is to cut your original image into chunks that will not be bigger than 640x520... But that will require some pretty heavy listing on the client side.

Added: This app engine issue regarding image size limits may have some helpful pointers

Added: You can probably leverage the finding that you had in your initial revision of this question... you said that crop worked but resize did not... This will allow you to keep most of the processing on the server-side.

Added: Another thread about the effects of small JPG that transforms into a larger image

倒数 2024-08-31 01:38:31

图片 API 不会引发 RequestTooLargeError(请参阅此处与图片 API 相关的异常)。这表明您的总请求大小太大。

您还随请求发送哪些其他数据?尽管如果请求相当简单(即仅上传单个图像),则可能很难将总请求超过 10MB(这是最大请求大小)。

The image API would not raise a RequestTooLargeError (see exceptions related to image API here). It would indicate that your total request size is too big.

What other data are you sending over with the request? Although it probably would be hard to push the total request over 10MB (which is the maximum request size) if it's a fairly simple request (i.e. just uploading a single image).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文