Comments (8)
前面加nginx了嘛? 如果有加的话需要调一下 nginx的
client_max_body_size
确定了一下,就是我的api不兼容大文件,确实是需要压缩一下才能用🙃
from chatgpt-web.
前面加nginx了嘛? 如果有加的话需要调一下 nginx的
client_max_body_size
为了解决这个问题我用python弄了个图片压缩服务器,在请求api的时候多一次图片压缩的请求体转发
from flask import Flask, request, jsonify
import base64
import io
from PIL import Image
app = Flask(__name__)
@app.route('/', defaults={'path': ''}, methods=['POST'])
@app.route('/<path:path>', methods=['POST'])
def compress_image(path):
data = request.get_json()
image_data = data.get('image')
image_bytes = base64.b64decode(image_data)
image = Image.open(io.BytesIO(image_bytes))
image = image.convert('RGB')
quality = 80
compressed_image_buffer = io.BytesIO()
image.save(compressed_image_buffer, format='JPEG', optimize=True, quality=quality)
compressed_image_buffer.seek(0)
compressed_image_base64 = base64.b64encode(compressed_image_buffer.getvalue()).decode('utf-8')
return jsonify({'image': compressed_image_base64})
if __name__ == '__main__':
app.run()
from chatgpt-web.
chagpt 自己会压缩分辨率的啊。
是大小直接超过20MB了都? 这个确实没有进一步处理。一般图片不至于这么大吧...
from chatgpt-web.
chagpt 自己会压缩分辨率的啊。 是大小直接超过20MB了都? 这个确实没有进一步处理。一般图片不至于这么大吧...
我也不知道为啥,实测nextweb是没问题的,小文件也没问题,4MB左右的都不行,下次我再排查一下试试吧,我用的oneapi转换的
from chatgpt-web.
前面加nginx了嘛? 如果有加的话需要调一下 nginx的 client_max_body_size
from chatgpt-web.
前面加nginx了嘛? 如果有加的话需要调一下 nginx的
client_max_body_size
加过了,不知道报错在什么地方,等我有空再次复现仔细查看一下日志再向您反馈,感谢
from chatgpt-web.
nodejs有合适的库能干这个么。有的话可以考虑把这个功能集成到项目里面来。
from chatgpt-web.
nodejs有合适的库能干这个么。有的话可以考虑把这个功能集成到项目里面来。
前端的压缩方法挺多的,我只是不会js😵
from chatgpt-web.
Related Issues (20)
- 新用户全局次数设置,是否可以实现每日重置呢? HOT 1
- 程序内容回答过多的时候需要手动下拉才能到最底下
- 怎么在vercel上部署? HOT 1
- 冒昧问下更新后设置key的地方在哪里? HOT 2
- 最新版本【aaae763】的复制功能用不了,麻烦复原下原来的!!! HOT 6
- 【错误】连续对话错误
- 对话失败|怎么设置代理地址? HOT 1
- 随着4o模型的出现,是否能支持多模态的内容输入和输出 HOT 1
- FR: 用户输入增加渲染markdown语法支持 HOT 3
- GPT4怎么突然记不住上一段内容? HOT 2
- 4o模型没有图片输入吗 HOT 4
- 建议增加一个默认模型配置项,当前默认gpt-turbo可以一键配置为其它如gpt4-xxx
- 建议增加一个全局搜索的功能
- 设置标志不见了 HOT 1
- 只开发前端,删除service文件夹之后会报错 HOT 1
- 没有使用反代依然没有打字机效果 HOT 1
- 等待回答时,这种效果是否要比现在的效果好呢?
- 手工部署项目后500错误
- 大佬们,渲染markdown语法有帮助的 mermaid-it-markdown库可以考虑添加?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt-web.