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)
|
function! zencoding#util#getImageSize(fn)
|
||||||
let fn = a:fn
|
let fn = a:fn
|
||||||
|
|
||||||
if filereadable(fn) && zencoding#util#isImageMagickInstalled()
|
if zencoding#util#isImageMagickInstalled()
|
||||||
return zencoding#util#imageSizeWithImageMagick(fn)
|
return zencoding#util#imageSizeWithImageMagick(fn)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if filereadable(fn)
|
if filereadable(fn)
|
||||||
@@ -234,13 +234,16 @@ function! zencoding#util#getImageSize(fn)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! zencoding#util#imageSizeWithImageMagick(fn)
|
function! zencoding#util#imageSizeWithImageMagick(fn)
|
||||||
let img_info = system('identify -format "%wx%h" "'.a:fn.'"')
|
let img_info = system('identify -format "%wx%h" "'.a:fn.'"')
|
||||||
let img_size = split(img_info, 'x')
|
let img_size = split(img_info, 'x')
|
||||||
let width = img_size[0]
|
let width = img_size[0]
|
||||||
let height = substitute(img_size[1], '\n', '', '')
|
let height = substitute(img_size[1], '\n', '', '')
|
||||||
return [width, height]
|
return [width, height]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! zencoding#util#isImageMagickInstalled()
|
function! zencoding#util#isImageMagickInstalled()
|
||||||
return executable('identify')
|
if !get(s:, 'zencoding_use_identify', 1)
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
return executable('identify')
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" File: zencoding.vim
|
" File: zencoding.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 09-Jul-2012.
|
" Last Change: 13-Feb-2013.
|
||||||
" Version: 0.74
|
" Version: 0.75
|
||||||
" WebPage: http://github.com/mattn/zencoding-vim
|
" WebPage: http://github.com/mattn/zencoding-vim
|
||||||
" Description: vim plugins for HTML and CSS hi-speed coding.
|
" Description: vim plugins for HTML and CSS hi-speed coding.
|
||||||
" SeeAlso: http://code.google.com/p/zen-coding/
|
" SeeAlso: http://code.google.com/p/zen-coding/
|
||||||
|
|||||||
Reference in New Issue
Block a user