Skip to content

Commit

Permalink
Add a setting for the video size (closes #35).
Browse files Browse the repository at this point in the history
  • Loading branch information
saimn committed Oct 16, 2013
1 parent 440ef5f commit 89a96b5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
3 changes: 1 addition & 2 deletions sigal/gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,7 @@ def process_video(filepath, outpath, settings):
copy(filepath, join(outpath, settings['orig_dir'], filename),
symlink=settings['orig_link'])

# TODO: Add specific video size settings
video.generate_video(filepath, outname, settings['img_size'],
video.generate_video(filepath, outname, settings['video_size'],
settings['webm_options'])

if settings['make_thumbs']:
Expand Down
43 changes: 22 additions & 21 deletions sigal/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,36 @@
import os

_DEFAULT_CONFIG = {
'source': '',
'destination': '_build',
'img_size': (640, 480),
'img_processor': 'ResizeToFit',
'adjust_options': {'color': 1.0, 'brightness': 1.0,
'contrast': 1.0, 'sharpness': 1.0},
'make_thumbs': True,
'thumb_prefix': '',
'thumb_suffix': '',
'thumb_size': (200, 150),
'thumb_dir': 'thumbnails',
'thumb_fit': True,
'copy_exif_data': True,
'copyright': '',
'destination': '_build',
'google_analytics': '',
'img_ext_list': ['.jpg', '.jpeg', '.JPG', '.JPEG', '.png'],
'img_processor': 'ResizeToFit',
'img_size': (640, 480),
'index_in_url': False,
'jpg_options': {'quality': 85, 'optimize': True, 'progressive': True},
'keep_orig': False,
'links': '',
'locale': '',
'make_thumbs': True,
'orig_dir': 'original',
'orig_link': False,
'jpg_options': {'quality': 85, 'optimize': True, 'progressive': True},
'source': '',
'theme': 'colorbox',
'thumb_dir': 'thumbnails',
'thumb_fit': True,
'thumb_prefix': '',
'thumb_size': (200, 150),
'thumb_suffix': '',
'vid_ext_list': ['.MOV', '.mov', '.avi', '.mp4', '.webm', '.ogv'],
'video_size': (480, 360),
'webm_options': {'crf': '10', 'bitrate': '1.6M',
'qmin': '4', 'qmax': '63'},
'copyright': '',
'img_ext_list': ['.jpg', '.jpeg', '.JPG', '.JPEG', '.png'],
'vid_ext_list': ['.MOV', '.mov', '.avi', '.mp4', '.webm', '.ogv'],
'theme': 'colorbox',
'write_html': True,
'index_in_url': False,
'zip_gallery': False,
'links': '',
'google_analytics': '',
'copy_exif_data': True,
'locale': ''
}


Expand Down Expand Up @@ -119,7 +120,7 @@ def read_settings(filename=None):
settings_path, path)))
logger.debug("Rewrite %s : %s -> %s", p, path, settings[p])

for key in ('img_size', 'thumb_size'):
for key in ('img_size', 'thumb_size', 'video_size'):
w, h = settings[key]
if h > w:
settings[key] = (h, w)
Expand Down
2 changes: 2 additions & 0 deletions sigal/templates/sigal.conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
# 'qmin': '4',
# 'qmax': '63'}

# Size of resized video (default: (480, 360))
# video_size = (480, 360)

# Write HTML files. If False, sigal will only process the images.
# write_html = True
Expand Down

0 comments on commit 89a96b5

Please sign in to comment.