Php:将blob转换为图像文件 [英] Php : Convert a blob into an image file

查看:390
本文介绍了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的内容,将其写入文件,然后vo ...你得到了一个图像。

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转换为图像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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