安装后运行Image magick代码(Running Image magick code after installation)
我刚刚在我的centos中安装了Imagemagick和imagick
yum install ImageMagick yum install ImageMagick-devel cd /root wget http://pecl.php.net/get/imagick-3.0.1.tgz tar zxf imagick-3.0.1.tgz cd imagick-3.0.1 phpize ./configure make make install
安装顺利没有任何错误,但现在我试图运行,php ImageMagick代码
<?php $cmd = " -background none -pointsize 60 -font DRAGM.ttf -fill red ". " -strokewidth 1 -stroke black label:\"myexample\" "; exec("convert $cmd coloured_font.png"); ?>
编辑:我也试过这段代码......但是它仍然显示一个空白页...
<?php /* Create some objects */ $image = new Imagick(); $draw = new ImagickDraw(); $pixel = new ImagickPixel( 'gray' ); /* New image */ $image->newImage(800, 75, $pixel); /* Black text */ $draw->setFillColor('black'); /* Font properties */ $draw->setFont('Bookman-DemiItalic'); $draw->setFontSize( 30 ); /* Create text */ $image->annotateImage($draw, 10, 45, 0, 'The quick brown fox jumps over the lazy dog'); /* Give image a format */ $image->setImageFormat('png'); /* Output the image with headers */ header('Content-type: image/png'); echo $image;
php.info显示
imagick模块启用imagick模块版本 3.0.1 imagick类 Imagick,ImagickDraw,ImagickPixel,ImagickPixelIterator ImageMagick版本 ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org ImageMagick版权版权所有(C)1999- 2009 ImageMagick Studio LLC ImageMagick发布日期 2012-05-07 ImageMagick支持的格式数量: 198 ImageMagick支持的格式 A,AI,ART,ARW,AVI,AVS,B,BGR,BMP,BMP2,BMP3,BRF,BRG,C, CALS,CAPTION,CIN,CIP,CLIP,CMYK,CMYKA,CR2,CRW,CUR,CUT,DCM,DCR,DCX,DDS,DFONT,DNG,DOT,DPS,DPX,EPDF,EPI,EPS,EPS2,EPS3, EPSF,EPSI,EPT,EPT2,EPT3,ERF,FAX,FITS,FRACTAL,FTS,G,G3,GBR,GIF,GIF87,GRADIENT,GRAY,GRB,HALD,HISTOGRAM,HRZ,HTM,HTML,ICB,ICO, ICON,INFO,INLINE,IPL,ISOBRL,JNG,JP2,JPC,JPEG,JPG,JPX,K,K25,KDC,LABEL,M,M2V,M4V,MAP,MAT,MATTE,MIFF,MNG,MONO,MOV, MP4,MPC,MPEG,MPG,MRW,MSL,MSVG,MTV,MVG,NEF,NULL,O,ORF,OTB,OTF,PAL,PALM,PAM,PATTERN,PBM,PCD,PCDS,PC L,PCT,PCX,PDB,PDF,PDFA,PEF,PFA,PFB,PFM,PGM,PGX,PICON,PICT,PIX,PJPEG,PLASMA,PNG,PNG24,PNG32,PNG8,PNM,PPM,PREVIEW,PS, PS2,PS3,PSD,PTIF,PWP,R,RADIAL-GRADIENT,RAF,RAS,RBG,RGB,RGBA,RGBO,RLA,RLE,SCR,SCT,SFW,SGI,SHTML,SR2,SRF,STEGANO,SUN, SVG,SVGZ,TEXT,TGA,THUMBNAIL,TIFF,TIFF64,TILE,TIM,TTC,TTF,TXT,UBRL,UIL,UYVY,VDA,VICAR,VID,VIFF,VST,WBMP,WMF,WMV,WMZ,WPG, X,X3F,XBM,XC,XCF,XPM,XPS,XV,XWD,Y,YCbCr,YCbCrA,YUV
理想情况下,它应该使用文本
myexample
创建图像,但它不起作用,有没有办法解决这个问题?I have just installed Imagemagick and imagick in my centos .using
yum install ImageMagick yum install ImageMagick-devel cd /root wget http://pecl.php.net/get/imagick-3.0.1.tgz tar zxf imagick-3.0.1.tgz cd imagick-3.0.1 phpize ./configure make make install
Installation went fine without any errors , but now iam trying to run, php ImageMagick code
<?php $cmd = " -background none -pointsize 60 -font DRAGM.ttf -fill red ". " -strokewidth 1 -stroke black label:\"myexample\" "; exec("convert $cmd coloured_font.png"); ?>
Edit: I have also tried this code... but still it's displaying a blank page...
<?php /* Create some objects */ $image = new Imagick(); $draw = new ImagickDraw(); $pixel = new ImagickPixel( 'gray' ); /* New image */ $image->newImage(800, 75, $pixel); /* Black text */ $draw->setFillColor('black'); /* Font properties */ $draw->setFont('Bookman-DemiItalic'); $draw->setFontSize( 30 ); /* Create text */ $image->annotateImage($draw, 10, 45, 0, 'The quick brown fox jumps over the lazy dog'); /* Give image a format */ $image->setImageFormat('png'); /* Output the image with headers */ header('Content-type: image/png'); echo $image;
php.info shows
imagick module enabled imagick module version 3.0.1 imagick classes Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator ImageMagick version ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org ImageMagick copyright Copyright (C) 1999-2009 ImageMagick Studio LLC ImageMagick release date 2012-05-07 ImageMagick number of supported formats: 198 ImageMagick supported formats A, AI, ART, ARW, AVI, AVS, B, BGR, BMP, BMP2, BMP3, BRF, BRG, C, CALS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DFONT, DNG, DOT, DPS, DPX, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FITS, FRACTAL, FTS, G, G3, GBR, GIF, GIF87, GRADIENT, GRAY, GRB, HALD, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, INFO, INLINE, IPL, ISOBRL, JNG, JP2, JPC, JPEG, JPG, JPX, K, K25, KDC, LABEL, M, M2V, M4V, MAP, MAT, MATTE, MIFF, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NULL, O, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG24, PNG32, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSD, PTIF, PWP, R, RADIAL-GRADIENT, RAF, RAS, RBG, RGB, RGBA, RGBO, RLA, RLE, SCR, SCT, SFW, SGI, SHTML, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, Y, YCbCr, YCbCrA, YUV
ideally it should create image with the text
myexample
, but its not working, is there any ways to fix this?
原文:https://stackoverflow.com/questions/15544582
最满意答案
示例模块包含许多开始使用的示例,包括电子邮件。 在这里看到它在api网站查看drupal_mail()函数来查看函数参数和用户示例以及函数的使用。
GIYF。
Examples module contains number of examples to get started with, including emails. see it in api site here See drupal_mail() function to see function params and user examples as well as function use.
GIYF.
相关问答
更多-
Gmail不会让你欺骗发件人,这正是你想要做的。 垃圾邮件发送者和诈骗者这样做。 您的Web主机是否有SMTP服务器? 试试吧。 另一种方法可能是将用户的地址设置为Reply-To标头。 它似乎来自你,但当你回复它时,至少会转到原始用户。 GMail可能还行。 Gmail isn't going to let you spoof the sender, which is what you're trying to do. Spammers and scammers do that. Does your We ...
-
如何使用drupal_mail在drupal 6中发送HTML电子邮件?(How to send HTML email in drupal 6 using drupal_mail?)[2023-03-21]
你可以在hook_mail_alter()中设置标题 You can to set the header in hook_mail_alter()使用Drupal规则向具有角色但只有一次的用户发送电子邮件(Using Drupal rules to email users with a role but only once)[2022-05-02]
我认为您可以通过自定义模块解决您的问题,其中创建一个设置此字段的操作规则。 在像你这样的情况下,我遵循这种方法。 搜索hook_rules_action_info()。 或者,如果使用profile2模块,您可以查看是否存在可以设置此值的规则。 我认为有因为Profile2支持规则。 M. I think that you can resolve your problem via a custom module where create an action rule that set this fields ...示例模块包含许多开始使用的示例,包括电子邮件。 在这里看到它在api网站查看drupal_mail()函数来查看函数参数和用户示例以及函数的使用。 GIYF。 Examples module contains number of examples to get started with, including emails. see it in api site here See drupal_mail() function to see function params and user examples a ...在特定内容类型内容创建中向电子邮件字段发送电子邮(send email to email field in specific content type content creation)[2022-04-17]
我确信这可以使用规则来完成,您只需要在规则操作中使用替换模式,所有字段值都可用,如节点标题的[node:title]和正文的[node:body]对于您的电子邮件字段,您必须将该替换字符串放在规则操作中的“To value”中。 希望能帮助到你。 I am sure this can be done using rule, you just need to use the replacement pattern there in rules action, all the fields value are ...http://drupal.org/project/htmlmail必须是你想要的。 “这个模块操作非常简单。它将从Drupal发送的所有传出电子邮件修改电子邮件中的标题更改为HTML,并选择页眉,页脚和CSS。” http://drupal.org/project/htmlmail must be what you are looking for. "This module is very simple in operation. It changes headers in all outgoing e- ...可以这样的工作吗? 它是一个私人消息插件,允许用户在网站上进行通信,它还为用户提供“通过电子邮件通知”选项。 假设我理解你的问题。 匿名因为无法看到对方的电子邮件。 Could something like this work? It is a private messaging addon, allowing users to communicate on the site, it also provides users with the option "notify-by-email". Assumin ...检查STMP和端口的phpinfo()信息。 执行test.php文件并尝试执行此操作。 mail('email@example.com', 'My Subject', 'Hello World'); Ah fixed it, well i didn't-one of our developers did. Apparently Drupal only uses 'Send Mail' so you have to have it installed, wont use php-mail.来自Mandrill的帮助 : 列表无法上传或存储在Mandrill中。 应在您自己的数据库或应用程序中管理收件人或订户列表。 然后,当您阅读发送电子邮件时,收件人信息将在您的API请求或SMTP邮件中传递给Mandrill。 注意:如果您正在寻找提供列表管理服务的服务以及创建和跟踪批量电子邮件的功能,请查看MailChimp 。 From Mandrill's help: Lists cannot be uploaded or stored in Mandrill. Recipient or subscr ...我想有更好的解决方案,但这是一个相当简单的方法。 我假设你知道如何基本上在Drupal中做一些事情,比如创建表单,在数据库中存储信息,发送邮件等等。 如果没有,每个都有一个链接...... 使用email(varchar),key(varchar),status(int)( hook_schema )定义表 创建一个表单,用户可以在其中输入电子邮件( 如何创建表单 将邮件与随机密钥一起存储在数据库中(如md5($ mail。uniqueid())(db_insert用于D7,db_query用于D6),将状 ...相关文章
更多- English,The Da Vinci Code,Chapter 1-3
- C#中Image.FromFile()的用法
- reading notes for solr source code
- win8安装VirtualBox-4.2.18提示Installation failed!error:系统找不到指定的路径
- 微信会员注册开发【带源码】:网页授权,得到code后在当前页面获取openid,js+php实现跨域请求
- Running Solr with Maven
- 搭建Eclipse下运行Mapreduce代码的环境
- 在Hadoop集群上运行R程序--安装RHadoop
- HDFS patch前后Ganglia看到running processes变化的分析
- 代码之谜(零)- 其实,你不懂代码
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)