added feature to scale down inline images with respect to aspect ratio #508

This commit is contained in:
Karel Picman 2016-02-18 09:21:41 +01:00
parent a0223234a8
commit 6efe4756d8

View File

@ -181,7 +181,7 @@ 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)
if size.include? "%"
if size && size.include?('%')
image_tag(url, :alt => file.title, :width => size, :height => size)
else
image_tag(url, :alt => file.title, :size => size)