为什么这个参数'+ profile'*''被转换为杀死?

时间:2015-04-27 07:21:23

标签: imagemagick ubuntu-14.04 imagemagick-convert

如果我运行此命令,

 convert  -limit memory 2071963648 -quality 100 -alpha off -density 165% -scene 1 infile.jpg outfile.png

转换运行没有任何问题。

但是,如果我添加+profile "*"

 convert +profile "*" -limit memory 2071963648 -quality 100 -alpha off -density 165% -scene 1 infile.jpg outfile.png

这个过程被杀了。

以下是dmesg

的输出
[ 1403.401440] [ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name
[ 1403.401444] [  474]     0   474     4869       49      13        0             0 upstart-udev-br
[ 1403.401446] [  480]     0   480    12460      207      27        0         -1000 systemd-udevd
[ 1403.401448] [  659]     0   659     3815       55      13        0             0 upstart-socket-
[ 1403.401449] [  671]     0   671     2556      572       8        0             0 dhclient
[ 1403.401451] [  852]   102   852     9806       94      23        0             0 dbus-daemon
[ 1403.401453] [  860]   101   860    65019      147      29        0             0 rsyslogd
[ 1403.401454] [  884]     0   884    10863       85      27        0             0 systemd-logind
[ 1403.401456] [  888]     0   888     3819       64      11        0             0 upstart-file-br
[ 1403.401463] [  967]     0   967     3635       41      12        0             0 getty
[ 1403.401464] [  970]     0   970     3635       42      12        0             0 getty
[ 1403.401466] [  974]     0   974     3635       40      12        0             0 getty
[ 1403.401467] [  975]     0   975     3635       40      12        0             0 getty
[ 1403.401468] [  977]     0   977     3635       41      12        0             0 getty
[ 1403.401470] [ 1047]     0  1047    15341      169      33        0         -1000 sshd
[ 1403.401472] [ 1052]     0  1052     5914       58      17        0             0 cron
[ 1403.401473] [ 1057]     0  1057     4785       40      13        0             0 atd
[ 1403.401475] [ 1089]     0  1089     1092       36       8        0             0 acpid
[ 1403.401476] [ 1099]     0  1099     4797       63      15        0             0 irqbalance
[ 1403.401478] [ 1224]     0  1224     6336       78      16        0             0 master
[ 1403.401479] [ 1230]   106  1230     6852       73      18        0             0 pickup
[ 1403.401481] [ 1231]   106  1231     6893       81      19        0             0 qmgr
[ 1403.401482] [ 1281]   999  1281   278175     5269      82        0             0 sensu-client
[ 1403.401484] [ 1397]     0  1397     3635       42      11        0             0 getty
[ 1403.401485] [ 1398]     0  1398     3197       37      11        0             0 getty
[ 1403.401487] [ 1515]   107  1515     7862      150      19        0             0 ntpd
[ 1403.401488] [ 1929]     0  1929    26408      247      55        0             0 sshd
[ 1403.401490] [ 1982]  1000  1982    26442      256      53        0             0 sshd
[ 1403.401491] [ 1983]  1000  1983     5580      761      16        0             0 bash
[ 1403.401493] [ 2488]  1000  2488     8685     1607      22        0             0 pynt
[ 1403.401494] [ 2490]  1000  2490     8685     1607      21        0             0 pynt
[ 1403.401495] [ 2491]  1000  2491     1111       24       7        0             0 sh
[ 1403.401497] [ 2492]  1000  2492     1111       25       7        0             0 sh
[ 1403.401498] [ 2493]  1000  2493    15638     3221      36        0             0 python
[ 1403.401500] [ 2494]  1000  2494    15939     3535      36        0             0 python
[ 1403.401501] [ 2924]  1000  2924   975967   954941    1894        0             0 convert
[ 1403.401503] Out of memory: Kill process 2924 (convert) score 945 or sacrifice child
[ 1403.406111] Killed process 2924 (convert) total-vm:3903868kB, anon-rss:3819760kB, file-rss:4kB

我正在使用此版本的ImageMagick

$ convert -version
Version: ImageMagick 6.8.9-7 Q16 x86_64 2014-12-30 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: jng jpeg png x xml zlib

on ubuntu 14.04.1

1 个答案:

答案 0 :(得分:1)

我不知道为什么-strip会导致ImageMagick崩溃,但作为替代方案,您可能会尝试这样convert image.jpg -strip output.jpg

 string[] files = { "f1.txt", "f2.txt" };

 var allLines = files.SelectMany(i => System.IO.File.ReadAllLines(i));

 System.IO.File.WriteAllLines("new.txt", allLines.ToArray());

它会删除所有个人资料和评论的图像。