Skip to content

Commit

Permalink
Added thumbnails and size info
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandojsg committed Feb 6, 2017
1 parent 954fea6 commit 8dd7d27
Show file tree
Hide file tree
Showing 44 changed files with 56 additions and 1,488 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.DS_Store
.cache
node_modules
npm-debug.log*
build/
1,468 changes: 0 additions & 1,468 deletions assets/images/envmap/miranda_uncropped.hdr

This file was deleted.

Binary file added assets/thumbs/images/bricksbrick_bump.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/bricksbrick_diffuse.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/bricksbrick_roughness.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/decaldecal-diffuse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/decaldecal-normal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/envmapenvmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/minecraftatlas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/minecraftdirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/minecraftgrass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/minecraftgrass_dirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/noisedisturb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/noiseperlin-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/noisewater.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/noisewaternormals.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/particleshexangle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/reflectionmetal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/spaceearth_atmos_2048.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/spaceearth_atmos_4096.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/spaceearth_clouds_1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/thumbs/images/spaceearth_clouds_2048.png
Binary file added assets/thumbs/images/spaceearth_lights_2048.png
Binary file added assets/thumbs/images/spaceearth_normal_2048.jpg
Binary file added assets/thumbs/images/spaceearth_specular_2048.jpg
Binary file added assets/thumbs/images/spacemoon_1024.jpg
Binary file added assets/thumbs/images/terraingrasslight-big-nm.jpg
Binary file added assets/thumbs/images/terraingrasslight-big.jpg
Binary file added assets/thumbs/images/uvgridUV_Grid_Lrg.jpg
Binary file added assets/thumbs/images/uvgridUV_Grid_Sm.jpg
Binary file added assets/thumbs/images/woodcrate.gif
Binary file added assets/thumbs/images/woodhardwood2_bump.jpg
Binary file added assets/thumbs/images/woodhardwood2_diffuse.jpg
Binary file added assets/thumbs/images/woodhardwood2_roughness.jpg
2 changes: 1 addition & 1 deletion dist/images.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"licenses":["MIT Three.js project\n","Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication License: http://creativecommons.org/publicdomain/zero/1.0/\n","http://painterlypack.net/\n","CC0 - Public Domain Donation by hackcraft.de\n\nhttp://opengameart.org/content/lens-flares-and-particles\nhttp://creativecommons.org/publicdomain/zero/1.0/\n","3D assets and textures for ROME \"3 Dreams of Black\" at http://ro.me are licensed\nunder a Creative CommonsAttribution-NonCommercial-ShareAlike 3.0 Unported License\n( http://creativecommons.org/licenses/by-nc-sa/3.0/ ).\n","Textures from http://opengameart.org/\n\nhttp://opengameart.org/content/dark-grass\nhttp://opengameart.org/content/backgrounds-topdown-games\n\nSlightly modified to have more GPU friendly sizes.\n\nLicensed under a Creative Commons Attribution 3.0 Unported License:\nhttp://creativecommons.org/licenses/by/3.0/","http://www.helloluxx.com/tutorials/cinema4d-2/cinema4d-materials/uv-grids/"],"images":[{"licenseId":0,"id":"brick_bump","path":"assets/images/bricks/brick_bump.jpg","tags":["images","bricks"]},{"licenseId":0,"id":"brick_diffuse","path":"assets/images/bricks/brick_diffuse.jpg","tags":["images","bricks"]},{"licenseId":0,"id":"brick_roughness","path":"assets/images/bricks/brick_roughness.jpg","tags":["images","bricks"]},{"licenseId":1,"id":"decaldiffuse","path":"assets/images/decal/decal-diffuse.png","tags":["images","decal"]},{"licenseId":1,"id":"decalnormal","path":"assets/images/decal/decal-normal.jpg","tags":["images","decal"]},{"licenseId":0,"id":"_24a3b8ef46_o","path":"assets/images/envmap/2294472375_24a3b8ef46_o.jpg","tags":["images","envmap"]},{"licenseId":0,"id":"envmap","path":"assets/images/envmap/envmap.png","tags":["images","envmap"]},{"licenseId":0,"id":"miranda_uncropped","path":"assets/images/envmap/miranda_uncropped.hdr","tags":["images","envmap"]},{"licenseId":0,"id":"pxcanestra_di_frutta_(caravaggio)","path":"assets/images/illustration/758px-Canestra_di_frutta_(Caravaggio).jpg","tags":["images","illustration"]},{"licenseId":2,"id":"atlas","path":"assets/images/minecraft/atlas.png","tags":["images","minecraft"]},{"licenseId":2,"id":"dirt","path":"assets/images/minecraft/dirt.png","tags":["images","minecraft"]},{"licenseId":2,"id":"grass","path":"assets/images/minecraft/grass.png","tags":["images","minecraft"]},{"licenseId":2,"id":"grass_dirt","path":"assets/images/minecraft/grass_dirt.png","tags":["images","minecraft"]},{"licenseId":0,"id":"disturb","path":"assets/images/noise/disturb.jpg","tags":["images","noise"]},{"licenseId":0,"id":"perlin512","path":"assets/images/noise/perlin-512.png","tags":["images","noise"]},{"licenseId":0,"id":"water","path":"assets/images/noise/water.jpg","tags":["images","noise"]},{"licenseId":0,"id":"waternormals","path":"assets/images/noise/waternormals.jpg","tags":["images","noise"]},{"licenseId":3,"id":"hexangle","path":"assets/images/particles/hexangle.png","tags":["images","particles"]},{"licenseId":4,"id":"lensflare0","path":"assets/images/particles/lensflare_rome/lensflare0.png","tags":["images","particles","lensflare_rome"]},{"licenseId":4,"id":"lensflare1","path":"assets/images/particles/lensflare_rome/lensflare1.png","tags":["images","particles","lensflare_rome"]},{"licenseId":4,"id":"lensflare2","path":"assets/images/particles/lensflare_rome/lensflare2.png","tags":["images","particles","lensflare_rome"]},{"licenseId":4,"id":"lensflare3","path":"assets/images/particles/lensflare_rome/lensflare3.png","tags":["images","particles","lensflare_rome"]},{"licenseId":0,"id":"metal","path":"assets/images/reflection/metal.jpg","tags":["images","reflection"]},{"licenseId":0,"id":"earth_atmos_2048","path":"assets/images/space/earth_atmos_2048.jpg","tags":["images","space"]},{"licenseId":0,"id":"earth_atmos_4096","path":"assets/images/space/earth_atmos_4096.jpg","tags":["images","space"]},{"licenseId":0,"id":"earth_clouds_1024","path":"assets/images/space/earth_clouds_1024.png","tags":["images","space"]},{"licenseId":0,"id":"earth_clouds_2048","path":"assets/images/space/earth_clouds_2048.png","tags":["images","space"]},{"licenseId":0,"id":"earth_lights_2048","path":"assets/images/space/earth_lights_2048.png","tags":["images","space"]},{"licenseId":0,"id":"earth_normal_2048","path":"assets/images/space/earth_normal_2048.jpg","tags":["images","space"]},{"licenseId":0,"id":"earth_specular_2048","path":"assets/images/space/earth_specular_2048.jpg","tags":["images","space"]},{"licenseId":0,"id":"moon_1024","path":"assets/images/space/moon_1024.jpg","tags":["images","space"]},{"licenseId":5,"id":"backgrounddetailed6","path":"assets/images/terrain/backgrounddetailed6.jpg","tags":["images","terrain"]},{"licenseId":5,"id":"grasslightbig-nm","path":"assets/images/terrain/grasslight-big-nm.jpg","tags":["images","terrain"]},{"licenseId":5,"id":"grasslightbig","path":"assets/images/terrain/grasslight-big.jpg","tags":["images","terrain"]},{"licenseId":6,"id":"uv_grid_lrg","path":"assets/images/uvgrid/UV_Grid_Lrg.jpg","tags":["images","uvgrid"]},{"licenseId":6,"id":"uv_grid_sm","path":"assets/images/uvgrid/UV_Grid_Sm.jpg","tags":["images","uvgrid"]},{"licenseId":0,"id":"crate","path":"assets/images/wood/crate.gif","tags":["images","wood"]},{"licenseId":0,"id":"hardwood2_bump","path":"assets/images/wood/hardwood2_bump.jpg","tags":["images","wood"]},{"licenseId":0,"id":"hardwood2_diffuse","path":"assets/images/wood/hardwood2_diffuse.jpg","tags":["images","wood"]},{"licenseId":0,"id":"hardwood2_roughness","path":"assets/images/wood/hardwood2_roughness.jpg","tags":["images","wood"]}]}
{"licenses":["MIT Three.js project\r\n","Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication License: http://creativecommons.org/publicdomain/zero/1.0/\r\n","http://painterlypack.net/\r\n","CC0 - Public Domain Donation by hackcraft.de\r\n\r\nhttp://opengameart.org/content/lens-flares-and-particles\r\nhttp://creativecommons.org/publicdomain/zero/1.0/\r\n","3D assets and textures for ROME \"3 Dreams of Black\" at http://ro.me are licensed\r\nunder a Creative CommonsAttribution-NonCommercial-ShareAlike 3.0 Unported License\r\n( http://creativecommons.org/licenses/by-nc-sa/3.0/ ).\r\n","Textures from http://opengameart.org/\r\n\r\nhttp://opengameart.org/content/dark-grass\r\nhttp://opengameart.org/content/backgrounds-topdown-games\r\n\r\nSlightly modified to have more GPU friendly sizes.\r\n\r\nLicensed under a Creative Commons Attribution 3.0 Unported License:\r\nhttp://creativecommons.org/licenses/by/3.0/","http://www.helloluxx.com/tutorials/cinema4d-2/cinema4d-materials/uv-grids/"],"basepath":{"images":"assets/images/","images_thumbnails":"assets/thumbs/images/"},"images":[{"licenseId":0,"id":"brick_bump","path":"bricks/brick_bump.jpg","tags":["images","bricks"],"thumbnail":"bricksbrick_bump.jpg","width":1024,"height":1024},{"licenseId":0,"id":"brick_diffuse","path":"bricks/brick_diffuse.jpg","tags":["images","bricks"],"thumbnail":"bricksbrick_diffuse.jpg","width":1024,"height":1024},{"licenseId":0,"id":"brick_roughness","path":"bricks/brick_roughness.jpg","tags":["images","bricks"],"thumbnail":"bricksbrick_roughness.jpg","width":1024,"height":1024},{"licenseId":1,"id":"decaldiffuse","path":"decal/decal-diffuse.png","tags":["images","decal"],"thumbnail":"decaldecal-diffuse.png","width":512,"height":512},{"licenseId":1,"id":"decalnormal","path":"decal/decal-normal.jpg","tags":["images","decal"],"thumbnail":"decaldecal-normal.jpg","width":512,"height":512},{"licenseId":0,"id":"_24a3b8ef46_o","path":"envmap/2294472375_24a3b8ef46_o.jpg","tags":["images","envmap"],"thumbnail":"envmap2294472375_24a3b8ef46_o.jpg","width":4096,"height":2048},{"licenseId":0,"id":"envmap","path":"envmap/envmap.png","tags":["images","envmap"],"thumbnail":"envmapenvmap.png","width":256,"height":256},{"licenseId":0,"id":"pxcanestra_di_frutta_(caravaggio)","path":"illustration/758px-Canestra_di_frutta_(Caravaggio).jpg","tags":["images","illustration"],"thumbnail":"illustration758px-Canestra_di_frutta_(Caravaggio).jpg","width":758,"height":600},{"licenseId":2,"id":"atlas","path":"minecraft/atlas.png","tags":["images","minecraft"],"thumbnail":"minecraftatlas.png","width":16,"height":32},{"licenseId":2,"id":"dirt","path":"minecraft/dirt.png","tags":["images","minecraft"],"thumbnail":"minecraftdirt.png","width":16,"height":16},{"licenseId":2,"id":"grass","path":"minecraft/grass.png","tags":["images","minecraft"],"thumbnail":"minecraftgrass.png","width":16,"height":16},{"licenseId":2,"id":"grass_dirt","path":"minecraft/grass_dirt.png","tags":["images","minecraft"],"thumbnail":"minecraftgrass_dirt.png","width":16,"height":16},{"licenseId":0,"id":"disturb","path":"noise/disturb.jpg","tags":["images","noise"],"thumbnail":"noisedisturb.jpg","width":512,"height":512},{"licenseId":0,"id":"perlin512","path":"noise/perlin-512.png","tags":["images","noise"],"thumbnail":"noiseperlin-512.png","width":512,"height":512},{"licenseId":0,"id":"water","path":"noise/water.jpg","tags":["images","noise"],"thumbnail":"noisewater.jpg","width":512,"height":512},{"licenseId":0,"id":"waternormals","path":"noise/waternormals.jpg","tags":["images","noise"],"thumbnail":"noisewaternormals.jpg","width":1024,"height":1024},{"licenseId":3,"id":"hexangle","path":"particles/hexangle.png","tags":["images","particles"],"thumbnail":"particleshexangle.png","width":128,"height":128},{"licenseId":4,"id":"lensflare0","path":"particles/lensflare_rome/lensflare0.png","tags":["images","particles","lensflare_rome"],"thumbnail":"particleslensflare_romelensflare0.png","width":128,"height":128},{"licenseId":4,"id":"lensflare1","path":"particles/lensflare_rome/lensflare1.png","tags":["images","particles","lensflare_rome"],"thumbnail":"particleslensflare_romelensflare1.png","width":128,"height":128},{"licenseId":4,"id":"lensflare2","path":"particles/lensflare_rome/lensflare2.png","tags":["images","particles","lensflare_rome"],"thumbnail":"particleslensflare_romelensflare2.png","width":512,"height":512},{"licenseId":4,"id":"lensflare3","path":"particles/lensflare_rome/lensflare3.png","tags":["images","particles","lensflare_rome"],"thumbnail":"particleslensflare_romelensflare3.png","width":128,"height":128},{"licenseId":0,"id":"metal","path":"reflection/metal.jpg","tags":["images","reflection"],"thumbnail":"reflectionmetal.jpg","width":512,"height":512},{"licenseId":0,"id":"earth_atmos_2048","path":"space/earth_atmos_2048.jpg","tags":["images","space"],"thumbnail":"spaceearth_atmos_2048.jpg","width":2048,"height":1024},{"licenseId":0,"id":"earth_atmos_4096","path":"space/earth_atmos_4096.jpg","tags":["images","space"],"thumbnail":"spaceearth_atmos_4096.jpg","width":2048,"height":1024},{"licenseId":0,"id":"earth_clouds_1024","path":"space/earth_clouds_1024.png","tags":["images","space"],"thumbnail":"spaceearth_clouds_1024.png","width":1024,"height":512},{"licenseId":0,"id":"earth_clouds_2048","path":"space/earth_clouds_2048.png","tags":["images","space"],"thumbnail":"spaceearth_clouds_2048.png","width":2048,"height":1024},{"licenseId":0,"id":"earth_lights_2048","path":"space/earth_lights_2048.png","tags":["images","space"],"thumbnail":"spaceearth_lights_2048.png","width":2048,"height":1024},{"licenseId":0,"id":"earth_normal_2048","path":"space/earth_normal_2048.jpg","tags":["images","space"],"thumbnail":"spaceearth_normal_2048.jpg","width":2048,"height":1024},{"licenseId":0,"id":"earth_specular_2048","path":"space/earth_specular_2048.jpg","tags":["images","space"],"thumbnail":"spaceearth_specular_2048.jpg","width":2048,"height":1024},{"licenseId":0,"id":"moon_1024","path":"space/moon_1024.jpg","tags":["images","space"],"thumbnail":"spacemoon_1024.jpg","width":1024,"height":512},{"licenseId":5,"id":"backgrounddetailed6","path":"terrain/backgrounddetailed6.jpg","tags":["images","terrain"],"thumbnail":"terrainbackgrounddetailed6.jpg","width":512,"height":512},{"licenseId":5,"id":"grasslightbig-nm","path":"terrain/grasslight-big-nm.jpg","tags":["images","terrain"],"thumbnail":"terraingrasslight-big-nm.jpg","width":2048,"height":2048},{"licenseId":5,"id":"grasslightbig","path":"terrain/grasslight-big.jpg","tags":["images","terrain"],"thumbnail":"terraingrasslight-big.jpg","width":2048,"height":2048},{"licenseId":6,"id":"uv_grid_lrg","path":"uvgrid/UV_Grid_Lrg.jpg","tags":["images","uvgrid"],"thumbnail":"uvgridUV_Grid_Lrg.jpg","width":1024,"height":1024},{"licenseId":6,"id":"uv_grid_sm","path":"uvgrid/UV_Grid_Sm.jpg","tags":["images","uvgrid"],"thumbnail":"uvgridUV_Grid_Sm.jpg","width":1024,"height":1024},{"licenseId":0,"id":"crate","path":"wood/crate.gif","tags":["images","wood"],"thumbnail":"woodcrate.gif","width":256,"height":256},{"licenseId":0,"id":"hardwood2_bump","path":"wood/hardwood2_bump.jpg","tags":["images","wood"],"thumbnail":"woodhardwood2_bump.jpg","width":2048,"height":1024},{"licenseId":0,"id":"hardwood2_diffuse","path":"wood/hardwood2_diffuse.jpg","tags":["images","wood"],"thumbnail":"woodhardwood2_diffuse.jpg","width":2048,"height":1024},{"licenseId":0,"id":"hardwood2_roughness","path":"wood/hardwood2_roughness.jpg","tags":["images","wood"],"thumbnail":"woodhardwood2_roughness.jpg","width":2048,"height":1024}]}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"bugs": {
"url": "https://github.com/aframevr/sample-assets/issues"
},
"homepage": "https://github.com/aframevr/sample-assets#readme"
"homepage": "https://github.com/aframevr/sample-assets#readme",
"devDependencies": {
"image-size": "^0.5.1"
}
}
65 changes: 47 additions & 18 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
var fs = require('fs'),
path = require('path'),
util = require('util')
util = require('util'),
gm = require('gm'),
sizeOf = require('image-size');

var THUMBNAIL_SIZE = 155;

function log (data) {
console.log(util.inspect(data, false, null));
Expand All @@ -15,13 +19,13 @@ function getValidId (name) {
.toLowerCase();
}

function getExtension (filename) {
return filename.toLowerCase().substr(filename.lastIndexOf('.') + 1);
function getExtension (path) {
return path.toLowerCase().substr(path.lastIndexOf('.') + 1);
}

function checkLicense (filename, licenseId) {
function checkLicense (path, licenseId) {
try {
var buf = fs.readFileSync(filename, "utf8");
var buf = fs.readFileSync(path, "utf8");
licenseId = licenses.push(buf) - 1;
} catch (e) {

Expand All @@ -37,47 +41,72 @@ var licenses = [];
var licenseExtension = 'txt';
var folderLicense = 'license.' + licenseExtension;

function dirTree (filename, licenseId, tags) {
var stats = fs.lstatSync(filename),
function processImages (fullpath, licenseId, tags, filename) {
var stats = fs.lstatSync(fullpath),
info = {};

if (stats.isDirectory()) {
licenseId = checkLicense(filename + '/' + folderLicense, licenseId);
licenseId = checkLicense(fullpath + '/' + folderLicense, licenseId);

info.name = path.basename(filename);
info.name = path.basename(fullpath);
info.isFolder = true;
var children = fs.readdirSync(filename);
if (filename !== 'images') { tags.push(info.name); }
var children = fs.readdirSync(fullpath);
if (fullpath !== 'images') { tags.push(info.name); }
info.children = children
.filter(function(child) {
if (fs.lstatSync(filename + '/' + child).isDirectory() || imageExtensions.indexOf(getExtension(child)) !== -1) {
if (fs.lstatSync(fullpath + '/' + child).isDirectory() || imageExtensions.indexOf(getExtension(child)) !== -1) {
return true;
}
return false;
})
.map(function(child) {
return dirTree(filename + '/' + child, licenseId, tags);
return processImages(fullpath + '/' + child, licenseId, tags, child);
});
if (filename !== 'images') { tags.pop(); }
if (fullpath !== 'images') { tags.pop(); }
} else {
var licenseFile = filename.substr(0, filename.lastIndexOf('.')) + '.' + licenseExtension;
var licenseFile = fullpath.substr(0, fullpath.lastIndexOf('.')) + '.' + licenseExtension;
licenseId = checkLicense(licenseFile, licenseId);

info.licenseId = licenseId;
info.id = getValidId(filename);
info.path = filename;
info.id = getValidId(fullpath);
info.path = fullpath.replace('assets/images/', '');
info.tags = tags.slice(0);
info.thumbnail = fullpath.replace('assets/images/', '').replace(/\//g, '');

// Generate thumbnail
gm(fullpath)
.resize(THUMBNAIL_SIZE, THUMBNAIL_SIZE)
.noProfile()
.write('assets/thumbs/images/' + info.thumbnail, function(err) {
if (err) {
console.log(err);
}
});

// Get image size synchronously
try {
var dimensions = sizeOf(fullpath);
info.width = dimensions.width;
info.height = dimensions.height;
} catch (e) {
info.width = 0;
info.heght = 0;
}

images.push(info);
}

return info;
}

dirTree('assets/images', -1, []);
processImages('assets/images', -1, []);

var data = {
licenses: licenses,
basepath: {
images: 'assets/images/',
images_thumbnails: 'assets/thumbs/images/'
},
images: images
};

Expand Down

0 comments on commit 8dd7d27

Please sign in to comment.