本文介绍了Php:将 blob 转换为图像文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是否可以使用 php 和 mysql 数据库将 blob 转换为图像文件?
Is this possible with php and a mysql database to Convert a blob into an image file?
推荐答案
如果 BLOB 包含图像的二进制数据(以可识别的格式,例如 tiff、png、jpeg 等),则采用 BLOB 的内容,将它写入一个文件,瞧...你得到了一个图像.
If the BLOB contains the binary data of an image (in a recognizable format like e.g. tiff, png, jpeg, etc), take the content of the BLOB, write it to a file, and voilà... you got an image.
在一些奇怪的操作系统上,你必须给输出文件一个相应的扩展名,这样图像文件才能被识别.
On some strange operation systems you have to give the output file a correspondig extension, so that the image file can be recognised as such.
这篇关于Php:将 blob 转换为图像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!