尝试转换图像时出错 < App Engine 中 1 MB
因此,我知道 App Engine 会阻止处理大小超过 1 MB 的图像,但当我对磁盘上大小为 400K 的 jpg 调用 images.resize 时,会收到 RequestTooLargeError 错误。 jpg 的尺寸为 1600 x 1200,那么应用程序引擎是否无法处理超过 1 兆像素的图像大小调整,即使图像文件本身是小于 1 MB 的压缩格式?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是最好的猜测......不是真正的答案。
根据我在这里和其他一些线程中读到的内容,图像 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
图片 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).