如何创建 .BMP 文件的缩略图?
我使用 imagecreatefromjpeg
、imagecreatefromgif
和 imagecreatefrompng
函数来创建 image/jpeg
、image/ 的缩略图gif
和 image/png
mimes。
我还想创建 .BMP
文件的缩略图。
我检查了一个文件,发现它的 mime 是 image/x-ms-bmp
。
但是,我找不到合适的 imagecreatefrom...
函数。
请建议。
I use imagecreatefromjpeg
, imagecreatefromgif
, and imagecreatefrompng
functions to create thumbnails of image/jpeg
, image/gif
, and image/png
mimes.
I would like also to create thumbnails of .BMP
files.
I checked one file and found out that its mime is image/x-ms-bmp
.
However, I cannot find an appropriate imagecreatefrom...
function.
Please suggest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
PHP 没有内置的 BMP 图像函数。
已经尝试创建函数来执行此操作。
您可以在 PHP 文档中的此注释中找到一个强大且记录良好的版本: http://www.php.net/manual/en/function.imagecreatefromwbmp.php#86214
这是该评论中的函数,没有优秀的文档,这使得更长但更具可读性:
PHP does not have built in image functions for BMP.
There have been a few attempts to create functions to do this.
You can find a robust and well documented version in this comment in the PHP documentation: http://www.php.net/manual/en/function.imagecreatefromwbmp.php#86214
Here is the function from that comment without the excellent documentation which makes much longer but much more readable:
像这个人描述的那样怎么样:
http://www.php.net /manual/en/function.imagecreate.php#53879
how about something like this guy describes:
http://www.php.net/manual/en/function.imagecreate.php#53879
有一个开源项目 PHP Image Magician,它允许您读取和写入 BMP 文件。请参阅此处:https://stackoverflow.com/a/11531747/577306
There is an opensource project, PHP Image Magician, that allows you to read and write BMP files. See here: https://stackoverflow.com/a/11531747/577306