mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 21:40:28 +01:00
add empty line after guard clause to lib/redmine/thumbnail.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20261 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -32,6 +32,7 @@ module Redmine
|
|||||||
def self.generate(source, target, size, is_pdf = false)
|
def self.generate(source, target, size, is_pdf = false)
|
||||||
return nil unless convert_available?
|
return nil unless convert_available?
|
||||||
return nil if is_pdf && !gs_available?
|
return nil if is_pdf && !gs_available?
|
||||||
|
|
||||||
unless File.exists?(target)
|
unless File.exists?(target)
|
||||||
mime_type = File.open(source) {|f| MimeMagic.by_magic(f).try(:type) }
|
mime_type = File.open(source) {|f| MimeMagic.by_magic(f).try(:type) }
|
||||||
return nil if mime_type.nil?
|
return nil if mime_type.nil?
|
||||||
@@ -42,6 +43,7 @@ module Redmine
|
|||||||
unless File.open(source) {|f| ALLOWED_TYPES.include? MimeMagic.by_magic(f).try(:type) }
|
unless File.open(source) {|f| ALLOWED_TYPES.include? MimeMagic.by_magic(f).try(:type) }
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
directory = File.dirname(target)
|
directory = File.dirname(target)
|
||||||
unless File.exists?(directory)
|
unless File.exists?(directory)
|
||||||
FileUtils.mkdir_p directory
|
FileUtils.mkdir_p directory
|
||||||
@@ -63,6 +65,7 @@ module Redmine
|
|||||||
|
|
||||||
def self.convert_available?
|
def self.convert_available?
|
||||||
return @convert_available if defined?(@convert_available)
|
return @convert_available if defined?(@convert_available)
|
||||||
|
|
||||||
begin
|
begin
|
||||||
`#{shell_quote CONVERT_BIN} -version`
|
`#{shell_quote CONVERT_BIN} -version`
|
||||||
@convert_available = $?.success?
|
@convert_available = $?.success?
|
||||||
|
|||||||
Reference in New Issue
Block a user