草庐IT

png_error

全部标签

php - 设置ImageMagick PNG图像背景颜色

我有一个PHP脚本来创建PDF文件的PNG缩略图,如下所示:setImageFormat("png");$im->resizeImage(200,200,1,0);//startbufferingob_start();$thumbnail=$im->getImageBlob();$contents=ob_get_contents();ob_end_clean();echo"";?>返回缩略图,但背景是透明的。我想设置白色背景颜色(将alpha层更改为白色)。我该怎么做? 最佳答案 解决方案不在于背景颜色,而在于alphachanne

php - 如何调试 "Maximum execution time" fatal error ?

我正在尝试在我的应用程序中使用Zend_acl。我遵循了“ZendFrameworkinaction”一书。我添加了这个助手:_auth=Zend_Auth::getInstance();$this->_acl=$options['acl'];//var_dump($this->_acl);die();}publicfunctioninit(){$this->_action=$this->getActionController();//addresourceforthiscontroller$controller=$this->_action->getRequest()->getCon

php - 使用 PHP 调整大小时如何在 PNG 上保持透明背景?

我在使用PHP调整图片大小时遇到​​问题,尤其是具有透明背景的PNG文件,而不是保持透明背景,它变成了黑色背景。我该如何解决这个问题?这是调整大小的脚本:image_type=$image_info[2];if($this->image_type==IMAGETYPE_JPEG){$this->image=imagecreatefromjpeg($filename);}elseif($this->image_type==IMAGETYPE_GIF){$this->image=imagecreatefromgif($filename);}elseif($this->image_type=

php - fatal error : Uncaught SoapFault exception: [soap:Client]

你好我的支付网关有问题,当网关中的工作完成并通过下面的编码返回到这个文件时.title{height:30px;}input{font-family:tahoma;}';//echo$this->package['cost'].'--'.$AppConfig['plus']['packages'][0]['cost'];//echo$st[1];//echo$AppConfig['plus']['payments']['paypal']['merchant_id'];if(isset($_POST['status'])&&$_POST['status']==100){$Resnumbe

php - imagecreatefromstring 使用带有数据 :image/png;base64, 的图像

我将图像存储为以以下内容开头的字符串:data:image/png;base64,我需要将它转换为普通图像以便与GD一起使用。我试过imagecreatefromstring()但它似乎只接受没有data:image/etc前缀的图像。我该怎么办? 最佳答案 $exploded=explode(',',$data,2);//limitto2parts,i.e:findthefirstcomma$encoded=$exploded[1];//pickupthe2ndpart$decoded=base64_decode($encoded

php - 将 .jpg、.jpeg 或 .gif 转换为 .png 而不将它们保存在机器上

是否可以在php中将.jpg、.jpeg或.gif图像转换为.png而无需将图像保存在计算机中?像这样的东西:functionread_image($filename,$extension){switch($extension){case'.png':$image=imagecreatefrompng($filename);break;case'.jpg':case'.jpeg':$unTransformed=imagecreatefromjpeg($filename);$image=transform($unTransformed);break;case'.gif':$unTrans

php - 更改错误日志输出格式 : ini_set ('error_append_string' , 'string' ) 和 ini_set ('error_prepend_string' , 'string' ) 什么都不做

这是我告诉php要做的:希望我能在一个文件中报告所有错误,在消息前加上“PRE”,在消息后加上“APP”。(我的目标是把PRE和APP做成/n/r什么的。。。)但是我的报错日志是这样的:[14-May-201300:16:26]PHPNotice:Undefinedvariable:nonexistentvariablein/home/www/dir/index.phponline14[14-May-201300:16:28]PHPNotice:Undefinedvariable:nonexistentvariablein/home/www/dir/index.phponline14没

PHP Nginx error_log 被截断

我正在运行nginx和PHP5.5,当传递的字符串很长时,我所有的error_log消息都会被截断。我已经更新了我的php.ini文件并将日志最大长度从1024增加到0(无最大值)并且它仍在发生。 最佳答案 如果你想要超过2048字节的日志行,你需要重新编译Nginx。来自http://wiki.nginx.org/HttpLuaModule:Nginx核心中的错误消息有硬编码的长度限制。最多2048字节,包括尾随换行符和前导时间戳。您可以通过修改Nginx源代码树中src/core/ngx_log.h文件中的NGX_MAX_ERR

php - 如何在 PHP 中调试 "Fatal error: Allowed memory size of xxx bytes exhausted"

调试“fatalerror:允许的268435456字节内存大小耗尽”错误的最佳策略是什么?我得到的这个错误很奇怪,显然有什么地方不对劲。导致它的功能是/***FlushalloutputbuffersforPHP5.2.**Makesurealloutputbuffersareflushedbeforeoursingletonsourdestroyed.**@since2.2.0*/functionwp_ob_end_flush_all(){$levels=ob_get_level();for($i=0;$i我只是重新设置了我正在处理的一些代码的基础,并开始使用它。你调试这个的策略是

php - 可捕获的 fatal error : Object of class PDOStatement could not be converted to string in line 114

这个问题在这里已经有了答案:returnonevaluefromdatabasewithmysqlphppdo(3个答案)关闭23天前。我正在尝试向我的数据库中添加一些数据,但我在第114行的/var/www/mandje.php中收到错误Catchablefatalerror:ObjectofclassPDOStatementcouldnotbeconvertedtostringin/var/www/mandje.php。这是我正在使用的代码:foreach($_SESSION["cart"]as$id=>$value){$query=$db->query('SELECT*FROMP