try:
os.makedirs(data['target_dir'])
- except Exception as e:
- logging.warn('failed to create target directory: %(msg)s' % {'msg': unicode(e)})
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ logging.warn('failed to create target directory: %(msg)s' % {'msg': unicode(e)})
# read the actual configuration from file
config_file_path = _CAMERA_CONFIG_FILE_PATH % {'id': camera_id}
div.picture-dialog-content {
position: relative;
+ text-align: center;
+ min-height: 100px;
}
div.picture-dialog-prev-arrow,
border: 1px solid #292929;
}
+img.picture-dialog-progress {
+ position: absolute;
+ background-color: #313131;
+ padding: 10px;
+ border-radius: 10px;
+ opacity: 0.7;
+}
+
/* camera frames */
var windowWidth = $(window).width();
+ var progressImg = $('<img class="picture-dialog-progress" src="' + staticUrl + 'img/modal-progress.gif">');
+
function updatePicture() {
var entry = entries[pos];
var width;
width = parseInt(windowWidth * 0.5);
}
- img.width(width);
- img.attr('src', '/picture/' + entry.cameraId + '/preview' + entry.path + '?width=' + width);
+ prevArrow.css('display', 'none');
+ nextArrow.css('display', 'none');
+ img.parent().append(progressImg);
+ updateModalDialogPosition();
+ progressImg.css('left', (img.parent().width() - progressImg.width()) / 2);
+ progressImg.css('top', (img.parent().height() - progressImg.height()) / 2);
- prevArrow.css('display', pos > 0 ? '' : 'none');
- nextArrow.css('display', pos < entries.length - 1 ? '' : 'none');
+ img.attr('src', '/picture/' + entry.cameraId + '/preview' + entry.path);
+ img.load(function () {
+ img.width(width);
+ updateModalDialogPosition();
+ prevArrow.css('display', pos > 0 ? '' : 'none');
+ nextArrow.css('display', pos < entries.length - 1 ? '' : 'none');
+ progressImg.remove();
+ });
$('div.modal-container').find('span.modal-title:last').html(entry.name);
updateModalDialogPosition();