1

node.js、grunt、および grunt プラグインを使用して、4000 個の画像のサイズを変更しようとしています。現在、私は使用してgrunt-imagemagickいますが、何を使用しても同様のエラーが発生します。

誰でもエラーに光を当てることができますか、または画像の適度に大きなディレクトリに対してOSXですぐに動作するうなり声プラグインを推奨できますか?

--stackオプションを指定して grunt タスクを実行したときのコンソールからの出力は次のとおりです。

$ grunt --stack imagemagick-resize

Running "imagemagick-resize:people" (imagemagick-resize) task
Beginning ImageMagick resizing process
resizing:../photos_src/organisms/Genus_Acanthostrongylophora^Species_ashmorica.jpg...
    ...
    ... (approx 170 files)
    ...
resizing:../photos_src/organisms/Genus_Chrysomelobia^species_lipsettae.jpg...
resizing:../photos_src/organisms/Genus_Chrysomelobia^species_vafer.jpg...
Warning: spawn EMFILE Use --force to continue.
Error: spawn EMFILE
    at errnoException (child_process.js:847:11)
    at ChildProcess.spawn (child_process.js:794:11)
    at Object.exports.spawn (child_process.js:618:9)
    at exec2 (/Users/user/Documents/projectName/node_modules/grunt-imagemagick/node_modules/node-imagemagick/lib/imagemagick.js:24:25)
    at Object.exports.convert (/Users/user/Documents/projectName/node_modules/grunt-imagemagick/node_modules/node-imagemagick/lib/imagemagick.js:262:10)
    at resizeCall (/Users/user/Documents/projectName/node_modules/grunt-imagemagick/node_modules/node-imagemagick/lib/imagemagick.js:267:22)
    at Object.exports.resize (/Users/user/Documents/projectName/node_modules/grunt-imagemagick/node_modules/node-imagemagick/lib/imagemagick.js:282:10)
    at Object.ResizeCommand.init (/Users/user/Documents/projectName/node_modules/grunt-imagemagick/tasks/imagemagick.js:112:13)
    at Object.<anonymous> (/Users/user/Documents/projectName/node_modules/grunt-imagemagick/tasks/imagemagick.js:222:11)
    at Object.task.registerMultiTask.thisTask (/Users/user/Documents/projectName/node_modules/grunt/lib/grunt/task.js:258:15)
4

1 に答える 1

0

ここにあなたの質問に対する答えがあるかもしれません: https://github.com/gruntjs/grunt/issues/788

EMFILEシステムが許可するよりも多くのファイル記述子を開こうとしていることを意味します。OSX を使用している場合、デフォルトは 256 で、非常に低い値です。セッションで一時的に増やすことができulimit -n 10480ます(独自のOSXを想定)。

于 2013-11-08T03:36:49.410 に答える