如何从请求 servlet 生成图像

发布于 2025-01-04 17:54:35 字数 354 浏览 6 评论 0原文

http://www.wupload.com/file/2662484487/example.rar -- 请下载这个以查看该字符串

我有包含 imageId、imageName 和图像内容的字符串。

首先,我仅对图像内容(jpg 格式)进行子串化,并将该图像内容转换为 Base64,但是当我将 Base64 转换为图像时,出现以下错误:

不是 jpeg 文件

有什么建议吗?我认为问题在于编码......

对不起我的英语。

http://www.wupload.com/file/2662484487/example.rar -- pls download this to see that string

I have string that contains imageId, imageName and image content.

First I substring it for only the image content (jpg format) and convert that image content to Base64, but when I convert Base64 to image, I've got this error:

not a jpeg file

Any suggestion? I think problem is encoding...

Sorry for my English.

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

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

发布评论

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

评论(1

水晶透心 2025-01-11 17:54:35

难道你不应该将图像内容放在字节数组中而不是字符串中吗?我曾经有一个关于压缩图像的项目,每当我将图像内容放入字符串中时,图像的字节排列似乎都会改变。

shouldn't you put the image content in a byte array instead in a string? I had a project once about compressing images and whenever I put the image content inside a string the byte arrangement of the image seems to change.

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