如何从请求 servlet 生成图像
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
难道你不应该将图像内容放在字节数组中而不是字符串中吗?我曾经有一个关于压缩图像的项目,每当我将图像内容放入字符串中时,图像的字节排列似乎都会改变。
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.