<commit_before>/**
 * Created by heavenduke on 16-8-13.
 */

let path = require('path');
let gm = require('gm').subClass({imageMagick: true});
Promise.promisifyAll(gm.prototype);
let fs = Promise.promisifyAll(require("fs"));

let get_thumb_path = function (image_path) {
    let dirname = path.dirname(image_path);
    let extname = path.extname(image_path);
    return path.join(dirname, path.basename(image_path, extname) + "_thumb" + extname);
}

let index = function *(next) {
    let Photo = global.database.models.photo;
    let photos = yield Photo.find({});
    this.render('./photos/index', {
        title: "相册列表",
        current_guest: this.session.guest,
        current_user: this.session.user,
        photos: photos,
        current_module: this.current_module,
        redirect_url: this.request.url
    });
};

let create = function *(next) {
    let image = this.request.body.files.photo;<commit_msg>修正一点小ｂｕｇ<commit_after>/**
 * Created by heavenduke on 16-8-13.
 */

let path = require('path');
let gm = require('gm').subClass({imageMagick: true});
Promise.promisifyAll(gm.prototype);
let fs = Promise.promisifyAll(require("fs"));

let get_thumb_path = function (image_path) {
    let dirname = path.dirname(image_path);
    let extname = path.extname(image_path);
    return path.join(dirname, path.basename(image_path, extname) + "_thumb" + extname);
}

let index = function *(next) {
    let Photo = global.database.models.photo;
    let photos = yield Photo.find({});
    this.render('./photos/index', {
        title: "相册列表",
        current_guest: this.session.guest,
        current_user: this.session.user,
        photos: photos,
        Photo: Photo,
        current_module: this.current_module,
        redirect_url: this.request.url
    });
};

let create = function *(next) {
    let image = this.request.body.files.photo;
{'fraction_non_alphanumeric': 0.14555256064690028, 'fraction_numerical': 0.005390835579514825, 'mean_word_length': 3.45083932853717, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3680776', 'n_tokens_mistral': 624, 'n_tokens_neox': 608, 'n_words': 129}