add zencoding_use_identify to disable. default is 1.

This commit is contained in:
mattn
2013-02-13 09:02:43 +09:00
parent 77c863af95
commit dc65299159
2 changed files with 13 additions and 10 deletions

View File

@@ -192,8 +192,8 @@ endfunction
function! zencoding#util#getImageSize(fn)
let fn = a:fn
if filereadable(fn) && zencoding#util#isImageMagickInstalled()
return zencoding#util#imageSizeWithImageMagick(fn)
if zencoding#util#isImageMagickInstalled()
return zencoding#util#imageSizeWithImageMagick(fn)
endif
if filereadable(fn)
@@ -234,13 +234,16 @@ function! zencoding#util#getImageSize(fn)
endfunction
function! zencoding#util#imageSizeWithImageMagick(fn)
let img_info = system('identify -format "%wx%h" "'.a:fn.'"')
let img_size = split(img_info, 'x')
let width = img_size[0]
let height = substitute(img_size[1], '\n', '', '')
return [width, height]
let img_info = system('identify -format "%wx%h" "'.a:fn.'"')
let img_size = split(img_info, 'x')
let width = img_size[0]
let height = substitute(img_size[1], '\n', '', '')
return [width, height]
endfunction
function! zencoding#util#isImageMagickInstalled()
return executable('identify')
if !get(s:, 'zencoding_use_identify', 1)
return 0
endif
return executable('identify')
endfunction

View File

@@ -1,8 +1,8 @@
"=============================================================================
" File: zencoding.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" Last Change: 09-Jul-2012.
" Version: 0.74
" Last Change: 13-Feb-2013.
" Version: 0.75
" WebPage: http://github.com/mattn/zencoding-vim
" Description: vim plugins for HTML and CSS hi-speed coding.
" SeeAlso: http://code.google.com/p/zen-coding/