Skip to content

Commit

Permalink
adds max thumbnail width to composite (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulbot committed Aug 19, 2013
1 parent 8691dc6 commit bd73c8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/image_compositor.rb
Expand Up @@ -9,6 +9,7 @@ class ImageCompositor

DEFAULT_CODE_COLOR = '#ff0000'
JPEG_IMAGE_QUALITY = 90
MAX_THUMBNAIL_WIDTH = (Threadx::DEFAULT_COMPOSITE_IMAGE_WIDTH/2).floor

def initialize start_date, end_date
@start_date = start_date
Expand All @@ -24,7 +25,8 @@ def padding
end

def thumb_width
((@width-self.padding*@duration).to_f / @duration.to_f).floor
[ ((@width-self.padding*@duration).to_f / @duration.to_f).floor,
MAX_THUMBNAIL_WIDTH ].min
end

def set_media_info id, name, max_image_height
Expand Down

0 comments on commit bd73c8c

Please sign in to comment.