代码之家  ›  专栏  ›  技术社区  ›  mattalxndr

ImageMagick`convert-composite`处理某些内容,而不是其他内容

  •  0
  • mattalxndr  · 技术社区  · 14 年前

    问题

    我在一堆不同的图片上运行一个convert命令。大多数情况下,它工作得很好,但是我注意到一些图像没有被水印,好像 -composite 指挥部根本就不在。

    指挥部

    convert src.jpg -colorspace RGB -resize 1500x1500\> -strip watermark.png -composite out.jpg
    

    这个 -colorspace , -resize ,和 -strip 在这个测试中并不需要命令。但如果我移除它们,我也会得到同样的结果:

    convert src.jpg watermark.png -composite out.jpg
    

    图像文件

    http://files.mattalexander.me/imtest.zip

    *** ~: unzip -l imtest.zip
    Archive:  imtest.zip
      Length      Date    Time    Name
    ---------  ---------- -----   ----
            0  2010-11-13 18:54   imtest/
        22676  2010-11-18 11:12   imtest/out.jpg
           48  2010-11-13 18:54   imtest/run
        23293  2010-11-13 18:47   imtest/src.jpg
        76232  2010-11-13 18:47   imtest/watermark.png
    ---------                     -------
       122249                     5 files
    

    软件版本

    服务器1

    *** ~: cat /etc/issue
    Ubuntu 9.10 \n \l
    *** ~: uname -a
    Linux *** 2.6.31-22-server #67-Ubuntu SMP Sat Oct 16 19:03:54 UTC 2010 x86_64     GNU/Linux
    *** ~: convert --version
    Version: ImageMagick 6.5.1-0 2009-08-27 Q16 OpenMP http://www.imagemagick.org
    Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
    

    服务器#2

    *** ~: cat /etc/issue
    CentOS release 5.5 (Final)
    Kernel \r on an \m
    *** ~: uname -a
    Linux *** 2.6.18-194.8.1.el5.028stab070.5 #1 SMP Fri Sep 17 19:10:36     MSD 2010 i686 i686 i386 GNU/Linux
    *** ~: convert --version
    Version: ImageMagick 6.2.8 10/20/10 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
    Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
    
    1 回复  |  直到 14 年前
        1
  •  1
  •   Richard Smith    14 年前

    我试过了,水印确实是用给定的命令应用的(我假设“\>”是一个错误,应该是“>”):

    convert src.jpg -colorspace RGB -resize 1500x1500> -strip watermark.png -composite out.jpg
    

    我在32位Windows上使用I m 6.6.5-8。

    然而,在给定的源图像上很难看到水印。

    输出文件在这里: out.jpg