Merge pull request #508 from chris-ibcsf/master
added feature to scale down inline images with respect to aspect ratio
This commit is contained in:
commit
a0223234a8
@ -119,6 +119,9 @@ Search will now automatically search DMSF content when a Redmine search is perfo
|
||||
####An inline picture with custom size
|
||||
`{{dmsf_image(8, size=300)}}`
|
||||
|
||||
####An inline picture with custom size
|
||||
`{{dmsf_image(8, size=50%)}}`
|
||||
|
||||
####An inline picture with custom size
|
||||
`{{dmsf_image(8, size=640x480)}}`
|
||||
|
||||
|
||||
6
init.rb
6
init.rb
@ -181,7 +181,11 @@ Redmine::Plugin.register :redmine_dmsf do
|
||||
end
|
||||
raise 'Not supported image format' unless file.image?
|
||||
url = url_for(:controller => :dmsf_files, :action => 'view', :id => file)
|
||||
image_tag(url, :alt => file.title, :size => size)
|
||||
if size.include? "%"
|
||||
image_tag(url, :alt => file.title, :width => size, :height => size)
|
||||
else
|
||||
image_tag(url, :alt => file.title, :size => size)
|
||||
end
|
||||
else
|
||||
raise "Document ID #{file_id} not found"
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user