Переглянути джерело

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

jomo 10 роки тому
батько
коміт
a6c74c9831
4 змінених файлів з 18 додано та 18 видалено
  1. 1 1
      modules/config.js
  2. 12 12
      public/stylesheets/style.css
  3. 3 3
      test/test.js
  4. 2 2
      views/index.jade

+ 1 - 1
modules/config.js

@@ -1,7 +1,7 @@
 var config = {
   min_size: 0,               // < 0 will (obviously) cause crash
   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
   browser_cache_time: 3600,  // seconds until browser will request image again
   http_timeout: 1000,        // ms until connection to mojang is dropped

+ 12 - 12
public/stylesheets/style.css

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

+ 3 - 3
test/test.js

@@ -27,13 +27,13 @@ describe('Avatar Serving', function(){
   });
   describe('Avatar', function(){
     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);
         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);
         done();
       });
@@ -44,7 +44,7 @@ describe('Avatar Serving', function(){
       cache.get_redis().flushall();
     });
     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);
         done();
       });

+ 2 - 2
views/index.jade

@@ -23,7 +23,7 @@ block content
 
         h3 Parameters
         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
         p The image to be returned when the uuid has no skin. <br> Valid options are 
           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.
 
         h3 Examples
-        p Get jeb_'s avatar, 180 × 180 pixels
+        p Get jeb_'s avatar, 160 × 160 pixels
         img(src="/avatars/853c80ef3c3749fdaa49938b674adae6")
         .well.code &lt;img src="#{domain}/avatars/853c80ef3c3749fdaa49938b674adae6"&gt;
         p Get jeb_'s avatar, 64 × 64 pixels