From 5f01cbb178a41bbdf816c6f5c4cf3f9618c495ee Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Tue, 16 Feb 2016 22:39:36 +0100 Subject: [PATCH 1/2] added auto scaling inline image functionality --- init.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.rb b/init.rb index 473db794..406f9581 100644 --- a/init.rb +++ b/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 From 164d62b1186c18db34b1cb0340d33ced30c09e83 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Tue, 16 Feb 2016 22:56:12 +0100 Subject: [PATCH 2/2] Update README.md Added macro description for proportional scale-down feature --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 4afc77ba..6af69759 100644 --- a/README.md +++ b/README.md @@ -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)}}`