diff --git a/README.md b/README.md
index e51cf86..e290e90 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ https://crafatar.com
Crafatar serves Minecraft avatars based on the skin for use in external applications.
Inspired by [Gravatar](https://gravatar.com) (hence the name) and [Minotar](https://minotar.net).
-Image manipulation is done by [lwip](https://github.com/EyalAr/lwip)
+Image manipulation is done by [lwip](https://github.com/EyalAr/lwip). Renders are created with [node-canvas](https://github.com/Automattic/node-canvas), based on math by [confuser](https://github.com/confuser/serverless-mc-skin-viewer).
    
## Usage / Documentation
@@ -19,6 +19,7 @@ You can [join us](https://webchat.esper.net/?channels=spongy) in #spongy on irc.
## Install
* Clone the repository
+* Install [node-canvas](https://github.com/Automattic/node-canvas/wiki#desktop) dependencies.
* `npm install`
* `redis-server`
* `cp "modules/config.example.js" "modules/config.js"`
diff --git a/modules/config.js b/modules/config.js
index 037a01d..e9eb39d 100644
--- a/modules/config.js
+++ b/modules/config.js
@@ -1,21 +1,19 @@
var config = {
- min_size: 1, // for avatars
- max_size: 512, // for avatars; too big values might lead to slow response time or DoS
- default_size: 160, // for avatars; size to be used when no size given
- local_cache_time: 1200, // seconds until we will check if the image changed. should be > 60 to prevent mojang 429 response
- browser_cache_time: 3600, // seconds until browser will request image again
- cleaning_interval: 3, // seconds interval: deleting images if disk size at limit
- cleaning_limit: 900000000000, // minumum required available KB on disk to trigger cleaning
- cleaning_amount: 50000, // amount of avatar (and their helm) files to clean
- http_timeout: 1000, // ms until connection to mojang is dropped
- faces_dir: 'skins/faces/', // directory where faces are kept. should have trailing '/'
- helms_dir: 'skins/helms/', // directory where helms are kept. should have trailing '/'
- skins_dir: 'skins/skins/', // directory where skins are kept. should have trailing '/'
- renders_dir: 'skins/renders/', // Directory where rendered skins are kept. should have trailing '/'
- debug_enabled: true, // enables logging.debug
- min_scale: 1, // for renders
- max_scale: 100, // for renders; too big values might lead to slow response time or DoS
- default_scale: 6, // for renders; scale to be used when no scale given
+ min_size: 1, // < 1 will (obviously) cause crash
+ max_size: 512, // too big values might lead to slow response time or DoS
+ default_size: 160, // size to be used when no size given
+ local_cache_time: 30, // seconds until we will check if the image changed. should be > 60 to prevent mojang 429 response
+ browser_cache_time: 30, // seconds until browser will request image again
+ http_timeout: 3000, // ms until connection to mojang is dropped
+ cleaning_interval: 1800, // seconds interval: deleting images if disk size at limit
+ cleaning_limit: 10240, // minumum required available KB on disk to trigger cleaning
+ cleaning_amount: 50000, // amount of avatar (and their helm) files to clean
+ http_timeout: 1000, // ms until connection to mojang is dropped
+ faces_dir: 'skins/faces/', // directory where faces are kept. should have trailing '/'
+ helms_dir: 'skins/helms/', // directory where helms are kept. should have trailing '/'
+ debug_enabled: true, // enables logging.debug
+ default_scale: 6, // the scale of rendered avatars
+ maximum_sale: 10 // the maximum scale of rendered avatars
};
module.exports = config;
\ No newline at end of file
diff --git a/views/index.jade b/views/index.jade
index fea4cd8..05f00ab 100644
--- a/views/index.jade
+++ b/views/index.jade
@@ -63,12 +63,42 @@ block content
| Replace
mark.green id
| with a Mojang UUID or username to get the related skin.
- | You are redirected to the textures URL, or the default image is served.
+ | The user's skin will be returned, or the default image is served.
| You can use the default parameter here as well.
.code
| #{domain}/skins/
mark.green id
+ a(id="renders", class="anchor")
+ a(href="renders")
+ h3 3D Renders
+ p
+ | Crafatar also provides support for 3D renders of Minecraft skins.
+ | Replace
+ mark.green id
+ | with a Mojang UUID or username to get an render for the skin.
+ .code
+ | #{domain}/renders/head/
+ mark.green id
+ .code
+ | #{domain}/renders/body/
+ mark.green id
+ | The default parameter can also be used here. The scale factor will not be applied.
+ | Using the helm parameter is also allowed, which will be overlayed onto the head.
+ | The head render type will return only a render of the skin's head, while the
+ | body render will return a render of the entire skin.
+
+ a(id="#render-parameters", class="#render-anchor")
+ a(href="#render-parameters")
+ h3 Render Parameters
+ a(id="scale", class="anchor")
+ a(href="#scale")
+ h4 scale
+ p
+ | The scale factor of the image #{config.min_scale} - #{config.max_scale}.
+ | Default is #{config.default_scale}. The actual size differs between the type of render.
+
+
a(id="http-headers", class="anchor")
a(href="#http-headers")
h3 HTTP headers
@@ -126,7 +156,7 @@ block content
.code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6
p Jeb's avatar, 64 × 64
.code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64
- p Jeb's avatar, 64 × 64, with helm
+ p Jeb's avatar, 64 × 64, with helmet
.code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64&helm
p Jeb's avatar, or fall back to steve
.code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=steve
@@ -138,6 +168,10 @@ block content
.code #{domain}/skins/853c80ef3c3749fdaa49938b674adae6
p Jeb's skin by username
.code #{domain}/skins/jeb_
+ p Render of Jeb's Head
+ .code #{domain}/renders/head/853c80ef3c3749fdaa49938b674adae6
+ p Render of Jeb's Body, with helmet, by username
+ .code #{domain}/renders/body/jeb_?helm
.col-md-2.center
.sideface.redstone_sheep(title="redstone_sheep")
.sideface.Jake0oo0(title="Jake0oo0")