summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-02-05 13:50:20 +0000
committerGo MAEDA <maeda@farend.jp>2019-02-05 13:50:20 +0000
commit4c38f461849e641a36023f24c8d8293ee2dba572 (patch)
treef2980b30477240e08eeff891080471588a78f127 /app
parent29063283da5d333b990e2ce3a8c6221133f305c9 (diff)
downloadredmine-4c38f461849e641a36023f24c8d8293ee2dba572.tar.gz
redmine-4c38f461849e641a36023f24c8d8293ee2dba572.zip
Makes sure the generated thumbnail is always of at least the requested size (#13688).
Patch by Jens Krämer and Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17850 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/attachment.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index ac9561c26..be9d0067d 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -209,7 +209,7 @@ class Attachment < ActiveRecord::Base
size = options[:size].to_i
if size > 0
# Limit the number of thumbnails per image
- size = (size / 50) * 50
+ size = (size / 50.0).ceil * 50
# Maximum thumbnail size
size = 800 if size > 800
else