use 160px as default - 180 results in irregular resized pixels (22,5px)

This commit is contained in:
jomo 2014-11-03 02:12:58 +01:00
parent c03c3ed1cc
commit a6c74c9831
4 changed files with 18 additions and 18 deletions

View File

@ -1,7 +1,7 @@
var config = { var config = {
min_size: 0, // < 0 will (obviously) cause crash min_size: 0, // < 0 will (obviously) cause crash
max_size: 512, // too big values might lead to slow response time or DoS max_size: 512, // too big values might lead to slow response time or DoS
default_size: 180, // size to be used when no size given default_size: 160, // size to be used when no size given
local_cache_time: 3600, // seconds until we will check if the image changed local_cache_time: 3600, // seconds until we will check if the image changed
browser_cache_time: 3600, // seconds until browser will request image again browser_cache_time: 3600, // seconds until browser will request image again
http_timeout: 1000, // ms until connection to mojang is dropped http_timeout: 1000, // ms until connection to mojang is dropped

View File

@ -30,36 +30,36 @@ mark.green {
word-wrap: break-word; word-wrap: break-word;
} }
.sideface { .sideface {
width: 180px; width: 160px;
height: 180px; height: 160px;
} }
.sideface.Jake0oo0 { .sideface.Jake0oo0 {
background:url("/avatars/2d5aa9cdaeb049189930461fc9b91cc5?size=180&default=alex"); background:url("/avatars/2d5aa9cdaeb049189930461fc9b91cc5?size=160&default=alex");
} }
.sideface.Jake0oo0:hover { .sideface.Jake0oo0:hover {
background:url("/avatars/2d5aa9cdaeb049189930461fc9b91cc5?size=180&default=alex&helm=true"); background:url("/avatars/2d5aa9cdaeb049189930461fc9b91cc5?size=160&default=alex&helm=true");
} }
.sideface.redstone_sheep { .sideface.redstone_sheep {
background:url("/avatars/ae795aa86327408e92ab25c8a59f3ba1?size=180&default=alex"); background:url("/avatars/ae795aa86327408e92ab25c8a59f3ba1?size=160&default=alex");
} }
.sideface.redstone_sheep:hover { .sideface.redstone_sheep:hover {
background:url("/avatars/ae795aa86327408e92ab25c8a59f3ba1?size=180&default=alex&helm=true"); background:url("/avatars/ae795aa86327408e92ab25c8a59f3ba1?size=160&default=alex&helm=true");
} }
.sideface.Notch { .sideface.Notch {
background:url("/avatars/069a79f444e94726a5befca90e38aaf5?size=180&default=alex"); background:url("/avatars/069a79f444e94726a5befca90e38aaf5?size=160&default=alex");
} }
.sideface.Notch:hover { .sideface.Notch:hover {
background:url("/avatars/069a79f444e94726a5befca90e38aaf5?size=180&default=alex&helm=true"); background:url("/avatars/069a79f444e94726a5befca90e38aaf5?size=160&default=alex&helm=true");
} }
.sideface.sk89q { .sideface.sk89q {
background:url("/avatars/0ea8eca3dbf647cc9d1ac64551ca975c?size=180&default=alex"); background:url("/avatars/0ea8eca3dbf647cc9d1ac64551ca975c?size=160&default=alex");
} }
.sideface.sk89q:hover { .sideface.sk89q:hover {
background:url("/avatars/0ea8eca3dbf647cc9d1ac64551ca975c?size=180&default=alex&helm=true"); background:url("/avatars/0ea8eca3dbf647cc9d1ac64551ca975c?size=160&default=alex&helm=true");
} }
.sideface.md_5 { .sideface.md_5 {
background:url("/avatars/af74a02d19cb445bb07f6866a861f783?size=180&default=alex"); background:url("/avatars/af74a02d19cb445bb07f6866a861f783?size=160&default=alex");
} }
.sideface.md_5:hover { .sideface.md_5:hover {
background:url("/avatars/af74a02d19cb445bb07f6866a861f783?size=180&default=alex&helm=true"); background:url("/avatars/af74a02d19cb445bb07f6866a861f783?size=160&default=alex&helm=true");
} }

View File

@ -27,13 +27,13 @@ describe('Avatar Serving', function(){
}); });
describe('Avatar', function(){ describe('Avatar', function(){
it("should be downloaded", function(done) { it("should be downloaded", function(done) {
helpers.get_avatar(uuid, false, 180, function(err, status, image) { helpers.get_avatar(uuid, false, 160, function(err, status, image) {
assert.equal(status, 2); assert.equal(status, 2);
done(); done();
}); });
}); });
it("should be local", function(done) { it("should be local", function(done) {
helpers.get_avatar(uuid, false, 180, function(err, status, image) { helpers.get_avatar(uuid, false, 160, function(err, status, image) {
assert.equal(status, 1); assert.equal(status, 1);
done(); done();
}); });
@ -44,7 +44,7 @@ describe('Avatar Serving', function(){
cache.get_redis().flushall(); cache.get_redis().flushall();
}); });
it("should be rate limited", function(done) { it("should be rate limited", function(done) {
helpers.get_avatar(uuid, false, 180, function(err, status, image) { helpers.get_avatar(uuid, false, 160, function(err, status, image) {
assert.equal(err, null); assert.equal(err, null);
done(); done();
}); });

View File

@ -23,7 +23,7 @@ block content
h3 Parameters h3 Parameters
h4 size h4 size
p The size of the image in pixels, 1 - 512. <br> Default is 180. p The size of the image in pixels, 1 - 512. <br> Default is 160.
h4 default h4 default
p The image to be returned when the uuid has no skin. <br> Valid options are p The image to be returned when the uuid has no skin. <br> Valid options are
a(href="/avatars/00000000000000000000000000000000?default=steve") steve a(href="/avatars/00000000000000000000000000000000?default=steve") steve
@ -41,7 +41,7 @@ block content
p Either 'local' or 'downloaded'. Local means that Crafatar already had the image on disk, while downloaded means that it was retrieved from Mojang's skin servers. p Either 'local' or 'downloaded'. Local means that Crafatar already had the image on disk, while downloaded means that it was retrieved from Mojang's skin servers.
h3 Examples h3 Examples
p Get jeb_'s avatar, 180 × 180 pixels p Get jeb_'s avatar, 160 × 160 pixels
img(src="/avatars/853c80ef3c3749fdaa49938b674adae6") img(src="/avatars/853c80ef3c3749fdaa49938b674adae6")
.well.code &lt;img src="#{domain}/avatars/853c80ef3c3749fdaa49938b674adae6"&gt; .well.code &lt;img src="#{domain}/avatars/853c80ef3c3749fdaa49938b674adae6"&gt;
p Get jeb_'s avatar, 64 × 64 pixels p Get jeb_'s avatar, 64 × 64 pixels