[Tickets #14833] Re: Error when communicating with the server with PDF Attachements
noreply at bugs.horde.org
noreply at bugs.horde.org
Mon Aug 6 15:44:09 UTC 2018
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: https://bugs.horde.org/ticket/14833
------------------------------------------------------------------------------
Ticket | 14833
Updated By | horde-support at ionknight.com
Summary | Error when communicating with the server with PDF
| Attachements
Queue | IMP
Version | 6.2.22
Type | Bug
State | Not A Bug
Priority | 1. Low
Milestone |
Patch |
Owners |
------------------------------------------------------------------------------
horde-support at ionknight.com (2018-08-06 15:44) wrote:
Just experienced the same problem on an up to date install of CentOS 7
that uses upstream released packages.
I would suggest that a more elegant solution would be....
--- Pdf-released.php 2018-07-05 01:31:00.000000000 -0500
+++ Pdf-patched.php 2018-08-06 10:32:10.828102717 -0500
@@ -139,10 +139,18 @@
if ($img instanceof Horde_Image_Imagick) {
/* Get rid of PDF transparency. */
$img->imagick->setImageBackgroundColor('white');
-
$img->imagick->setImageAlphaChannel(imagick::ALPHACHANNEL_REMOVE);
- return
$GLOBALS['injector']->getInstance('Horde_Core_Factory_Image')->create(array(
- 'data' =>
$img->imagick->mergeImageLayers(imagick::LAYERMETHOD_FLATTEN)->getImageBlob()
- ));
+ if (version_compare ( phpversion( 'imagick' ),
'3.3.0', '<' ) ) {
+ # Maintain compatibility with packaged OSes
+ return
$GLOBALS['injector']->getInstance('Horde_Core_Factory_Image')->create(array(
+ 'data' =>
$img->imagick->flattenImages()->getImageBlob()
+ ));
+ } else {
+ # Support Newer iMagick installations
+
$img->imagick->setImageAlphaChannel(imagick::ALPHACHANNEL_REMOVE);
+ return
$GLOBALS['injector']->getInstance('Horde_Core_Factory_Image')->create(array(
+ 'data' =>
$img->imagick->mergeImageLayers(imagick::LAYERMETHOD_FLATTEN)->getImageBlob()
+ ));
+ }
}
return $img->getImageAtIndex(0);
>
>> is it possible, that the ImageMagick version is too old on Centos 7.5 ?
>>
>> [root at dmz-sv-webmail ~]# rpm -q ImageMagick
>> ImageMagick-6.7.8.9-15.el7_2.x86_64
>> [root at dmz-sv-webmail ~]#
>
>
> Yep! This was it. I installed now
> ImageMagick6-6.9.10.6-1.el7.remi.x86_64 from remi's Repo and rebuilt
> the imagick pecl extension, and voila! now it works.
>
>
> So problem is solved now for me
>
More information about the bugs
mailing list