【问题标题】:Grunt.js - Grunt-favicons outputGrunt.js - Grunt-favicons 输出
【发布时间】:2014-07-22 04:21:18
【问题描述】:

我使用 Grunt 已经有一段时间了,这是第一次。由于某种奇怪的原因,我无法获得我正在尝试使用的这个新 npm 来工作。我跑了npm install grunt-favicons --save-dev,效果很好,我安装了ImageMagick,什么都没有。我有路径和未正确设置的路径,并且发出了咕哝声,它似乎工作正常。只是没有文件。我已经检查了文件夹权限和所有内容。我只是好奇那里的一些智能 cookie 是否知道该怎么做。

咕噜任务:

favicons: {
    options: {
        trueColor: true,
        precomposed: false,
        coast: true,
        windowsTile: true,
        tileBlackWhite: true,
    },
    files: {
        src: ['<%= config.src %>/img/favicon.png'],
        dest: '<%= config.dest %>/img/icons/'
    }
},

控制台输出:

$ grunt favicons
Running "favicons:files" (favicons) task
>> Created output folder at " public/assets/img/icons/ "
Resizing images for "app/assets/img/favicon.png"... OK
favicon.ico... OK
favicon.png... OK
apple-touch-icon.png... OK
apple-touch-icon-60x60-precomposed.png... OK
apple-touch-icon-72x72.png... OK
apple-touch-icon-76x76-precomposed.png... OK
apple-touch-icon-114x114.png... OK
apple-touch-icon-120x120-precomposed.png... OK
apple-touch-icon-144x144.png... OK
apple-touch-icon-152x152-precomposed.png... OK
coast-icon-228x228.png... OK
windows-tile-144x144.png... OK

【问题讨论】:

    标签: node.js imagemagick gruntjs favicon


    【解决方案1】:

    grunt-favicons 不会检查 imagemagick 的响应是否有错误,所以可能 imagemagick 命令都失败了,而 grunt-favicons 礼貌地告诉你“OK”。我的猜测是您可能缺少用于转换 PNG 的库。

    您应该会看到如下内容:

    $ convert -list configure | grep DELEGATES
    DELEGATES      jng jpeg png ps zlib
    

    如果 png 丢失,那是你的问题。 sudo apt-get install libpng-dev 然后我认为您需要重新安装 Imagemagick(我不确定,但这就是我所做的)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多