<commit_before>var fs = require('fs');
var extend = require('util')._extend;
var path = require('path');

var async = require('async');

var im = require('./im');
var utils = require('./utils');


function write(config, tpl, photos) {
    var albumPrefix = config.album.path && '../';

    photos.forEach(function(photo) {
        var ctx = extend(config, {});
        ctx.photo = photo;
        ctx.prefix = albumPrefix + '../..';
        var data = tpl(ctx);

        fs.writeFile(photo.path, data, utils.logError);
    });
}
exports.write = write;

function createStructure(config, paths, cb) {
    async.map(paths, function(d, cb) {
        var p = d.data;

        im.identify(path.join(config.input, p), function(err, features) {
            if(err) return cb(); // not all files are images

            var href = p.replace(path.extname(p), '.html');<commit_msg>Remove extra ../ from photo prefix path<commit_after>var fs = require('fs');
var extend = require('util')._extend;
var path = require('path');

var async = require('async');

var im = require('./im');
var utils = require('./utils');


function write(config, tpl, photos) {
    var albumPrefix = config.album.path && '../';

    photos.forEach(function(photo) {
        var ctx = extend(config, {});
        ctx.photo = photo;
        ctx.prefix = albumPrefix + '..';
        var data = tpl(ctx);

        fs.writeFile(photo.path, data, utils.logError);
    });
}
exports.write = write;

function createStructure(config, paths, cb) {
    async.map(paths, function(d, cb) {
        var p = d.data;

        im.identify(path.join(config.input, p), function(err, features) {
            if(err) return cb(); // not all files are images

            var href = p.replace(path.extname(p), '.html');
{'fraction_non_alphanumeric': 0.17149346961953435, 'fraction_numerical': 0.0, 'mean_word_length': 2.773019271948608, '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': '1299199', 'n_tokens_mistral': 546, 'n_tokens_neox': 538, 'n_words': 138}