是否可以将jpeg转换为字节或其他格式。 [英] is it possible to convert jpeg to bytes or some other formats .

查看:91
本文介绍了是否可以将jpeg转换为字节或其他格式。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想知道有没有办法将jpeg转换为字节,反之亦然,因为最终目的是通过C代码接收图像并将其插入到DB ....

Hi,

I would like to know are there any ways to convert jpeg to bytes and vice versa,because the ultimate aim is to receive images through C code and insert it into DB....

推荐答案

通常您收到(您没有指定接收它们的方式)图像为一堆字节。因此,不应对接收的数据进行特殊转换。另一方面,为了在数据库上存储二进制数据,你必须使用名为 BLOB 的东西,例如参见MySQL BLOB [ ^ ](这里您可以找到示例C代码此处 [ ^ ],查看将图像插入MySQL数据库部分)。
Usually you receive (you did not specify the way you receive them) images as bunchs of bytes. So no special tranformation on received data should be performed. On the other hand, in order to store binary data on the database then you have to use something called BLOB, see for instance MySQL BLOB[^] (here you may find sample C code here[^], check out the "Inserting images into MySQL database" section).


这篇关于是否可以将jpeg转换为字节或其他格式。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆