imagemagick

ImageMagick Is On Fire — CVE-2016–3714

If you use ImageMagick or an affected library, we recommend you mitigate the known vulnerabilities by doing at least one of these two things (but preferably both!):

Verify that all image files begin with the expected “magic bytes” corresponding to the image file types you support before sending them to ImageMagick for processing. (see FAQ for more info)
Use a policy file to disable the vulnerable ImageMagick coders. The global policy for ImageMagick is usually found in “/etc/ImageMagick”. The below policy.xml example will disable the coders EPHEMERAL, URL, MVG, and MSL.
policy.xml (updated 5/5)


  
  
  
  
  
  
  
  
  


Imagemagick thumbnails 背景填充

For example: An image which is 400×300 pixels shrunk to fit a 100×100 pixel box will normal (with the above) have a size of 100×75 pixels. We want to add some padding borders to the top and bottom of the image (and to the sides to be sure) to make the final thumbnail image always 100×100 pixels in size.
There are a number of ways to do this, and as of IM v6.3.2 the best way is using the “-extent” option. (continue reading…)


typo3 imagick png 失真

当用自定义方法$this->cObj->IMAGE生成png有时候会出现如下图情况.

解决方法:

$imgConf['file.']['params'] = ' ';

Converting transparent PNG to Jpeg

ImageMagick 6.3.2 with the MagickWand-API and I had troubles to convert and resize a partially transparent png to an jpg-file.
I tried the command line tools and the same things happend.

convert png.png png.jpg
–> a jpg-file is created and the transparent area is white

convert png.png -resize 500×400 png_small.jpg
–> a jpg-file in the right dimension is generated and the transparent area is black

What settings do i have to set if i want transparent areas always to be white?
(continue reading…)

1 Comment more...

background black instead of white for EPS->JPG

Part of the problem here was that your command line order is not quite right.
See here: http://www.imagemagick.org/Usage/basics/#cmdline

When you’re using “convert -colorspace RGB input.tiff output.jpg”, then it will still work, as ImageMagick will use it like that: “convert input.tiff -colorspace RGB output.jpg” But it’s better to specify it like that (first the input image, then the options, then the output image) right at the start. (continue reading…)


psd,eps,tif to jpg

  • psd: “/usr/bin/convert test1.psd[0] -profile ISOcoated_v2_eci.icc -profile eciRGB_v2.icc -resize 1000×1000 -size 1000×1000 xc:white +swap -compose over -composite -trim -colorspace RGB -quality 100 test1.jpg”
  • psd: “$imagick_path test1.psd[0] -profile ISOcoated_v2_eci.icc -profile eciRGB_v2.icc -geometry 1000×1000 -flatten -colorspace RGB -quality 100 test1.jpg”
  • eps: “$imagick_path test1.eps[0]  -density 600 -colorspace RGB -quality 100 test1.jpg”
  • tif:  “$imagick_path test1.tif[0]  -profile ISOcoated_v2_eci.icc -profile eciRGB_v2.icc -colorspace RGB  -antialias -geometry 1000×1000 -quality 100 test1.jpg”

密码保护:Imagemagick ICC配置文件实例

这是一篇受密码保护的文章,您需要提供访问密码:

要查看留言请输入您的密码。 more...

Imagemagick CMYK

一般场景

图片缩放

这方面的属于入门级内容,使用ImageMagick必定会用到该方面的功能。主要涉及到 -resize 参数,下面该参数效果进行展示(尺寸参数的细节请参考这里):

  • -resize 100×100: 将原图缩放为100×100,同时保持比例。(结果为:75X100)
  • -resize 100×100^:缩放原图,直到宽或高等于指定的缩放尺寸。(结果为:100×133)
  • -resize 100×100!:缩放原图并在必要时进行拉伸,以符合指定的缩放尺寸。(结果为 100×100,但图像变形了)
  • -resize 100X100>:当原图宽或高大于指定尺寸时才进行缩放,同时保持原图比例(结果为:75×100)
  • -resize 100X100<:当原图宽或高小于指定尺寸时才进行缩放,同时保持原图比例(结果为:150×200,因为不满足条件) (><参数可以搭配 ^! 使用) (continue reading…)

ImageMagick PDF to JPG convert error

error:

Postscript delegate failed

Solution

It looks like the input or output filenames are missing or have some problem. Look closer and it is an error caused by gswin32c.exe. ImageMagick uses gswin32c.exe from the Ghostscript package to convert PDF files. So, to fix this error make sure that:

  1. Ghostscript package is installed.
  2. The directory containing gswin32c.exe is in the PATH environment variable.

ImageMagick在图片中写中文的问题及解决

ImageMagick做个水印效果,先做一个简单版本,往图片里添加文字注释
安装ImageMagick和ghostscript(不装会报错:sh:gs:command not found)
如果是linux — CentOS的系统,只需要yum install ghostscript,yum install imagemagick即可 (continue reading…)


Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress