forked from VimPlug/emmet-vim
add zencoding_use_identify to disable. default is 1.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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/
|
||||
|
||||
Reference in New Issue
Block a user