GithubHelp home page GithubHelp logo

minotar / imgd Goto Github PK

View Code? Open in Web Editor NEW
195.0 195.0 61.0 1.6 MB

Minotar is a global avatar service that pulls your head off of your Minecraft.net skin, and allows it for use on several thousand sites.

Home Page: https://minotar.net/

License: The Unlicense

Go 94.17% Dockerfile 0.70% Shell 0.24% Makefile 1.32% Jsonnet 3.36% JavaScript 0.22%

imgd's Introduction

imgd

imgd is a simple avatar serving system. You're probably looking for Minotar.net

imgd is a single binary for quickly getting up and running with skins + processed avatars.

We also provide skind (just skins) and processd (just processing). You should then configure processd to point at your instance(s) or skind.

How to install?

Installation is simple - however it requires an installation of Go. Ensure you are set up there before trying these commands.

git clone https://github.com/minotar/imgd
cd imgd

make imgd

This should compile a binary to ./cmd/imgd/imgd which can then be used for serving your images.

Try ./cmd/imgd/imgd --help to see the options. You can also pass ENV vars (uppercasing and replacing -/. with _).

IMGD_SERVER_HTTP_LISTEN_PORT=8080 ./cmd/imgd/imgd

Thanks

Big thanks to lukegb for porting the old version of this script from PHP to Go.

imgd's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imgd's Issues

All Steve's!

Hey,

I can see this issue has been posted multiple times, but I've not been very successful at replicating Minotar on my server.

Website: http://avatar.tekkify.com/

Error when accessing that page: x509: certificate signed by unknown authority

The error appears 11 times, as their are 11 avatars.

I followed the instructions precisely, and setup nginx reverse proxy as follows:

server {
        listen 80;
        server_name avatar.tekkify.com;

        location / {
                proxy_pass http://localhost:9999;
        }
}

If you need any extra information, let me know. Help would be greatly appreciated! Thanks.

500 Service Error with non-cached skins

Skins that aren't in the cache and are called for the first time return a 500 Internal Server Error. Once they have been called once though they return to working.

I can't find where this might be happening in the code, but maybe searching through the error logs could point in the right direction?

Suggestion not an issue

For the users skin why not do something similar to this script (not my code) which creates a human usable version of the skin.

    function flip(&$img)
        {
            $size_x = imagesx($img);
            $size_y = imagesy($img);
            $temp = imagecreatetruecolor($size_x, $size_y);
            $x = imagecopyresampled($temp, $img, 0, 0, ($size_x - 1), 0, $size_x, $size_y, 0 - $size_x, $size_y);
            return $temp;
        }

// File and new size
    $filename = 'http://www.minecraft.net/skin/' . $_GET['user'] . '.png';

// Content type
    header('Content-Type: image/png');

// Load
    $rendered = imagecreatetruecolor(240, 480);
    $source = imagecreatefrompng($filename);
    $b = 120;
    $s = 8;

// Fill the new image with pink and set pink as the transparent colour
    $pink = imagecolorallocate($rendered, 255, 0, 255);
    imagefilledrectangle($rendered, 0, 0, 240, 480, $pink);
    imagecolortransparent($rendered, $pink);

// Create a flipped version of the image
    $fsource = flip($source);

// Annatomy of an imagecopyresampled function
// $dst_image , $src_image , $dst_x , $dst_y , $src_x , $src_y , $dst_w , $dst_h , $src_w , $src_h

// Check if we want to render the back or front
    if (isset($_GET['back'])) {
// Render the back

// Copy head
        imagecopyresampled($rendered, $source, $b / 2, 0, $s * 3, $s, $b, $b, $s, $s);

// Copy the head accesory
        imagecopyresampled($rendered, $source, $b / 2, 0, $s * 7, $s, $b, $b, $s, $s);

// Copy the body
        imagecopyresampled($rendered, $source, $b / 2, $b, $s * 4, $s * 2.5, $b, $b * 1.5, $s, $s * 1.5);

// Copy the left arm
        imagecopyresampled($rendered, $source, $b * 1.5, $b, $s * 6.5, $s * 2.5, $b / 2, $b * 1.5, $s / 2, $s * 1.5);

// Copy the right arm
        imagecopyresampled($rendered, $fsource, 0, $b, $s * 1, $s * 2.5, $b / 2, $b * 1.5, $s / 2, $s * 1.5);

// Copy the left leg
        imagecopyresampled($rendered,
            $source,
            $b * 1,
            $b * 2.5,
            $s * 1.5,
            $s * 2.5,
            $b / 2,
            $b * 1.5,
            $s / 2,
            $s * 1.5);

// Copy the right leg
        imagecopyresampled($rendered, $fsource, 60, $b * 2.5, $s * 6, $s * 2.5, $b / 2, $b * 1.5, $s / 2, $s * 1.5);
    } else {
// Render the front

// Copy head
        imagecopyresampled($rendered, $source, $b / 2, 0, $s, $s, $b, $b, $s, $s);

// Copy the head accesory
        imagecopyresampled($rendered, $source, $b / 2, 0, $s * 5, $s, $b, $b, $s, $s);

// Copy the body
        imagecopyresampled($rendered, $source, $b / 2, $b, $s * 2.5, $s * 2.5, $b, $b * 1.5, $s, $s * 1.5);

// Copy the left arm
        imagecopyresampled($rendered, $source, $b * 1.5, $b, $s * 5.5, $s * 2.5, $b / 2, $b * 1.5, $s / 2, $s * 1.5);

// Copy the right arm
        imagecopyresampled($rendered, $fsource, 0, $b, $s * 2, $s * 2.5, $b / 2, $b * 1.5, $s / 2, $s * 1.5);

// Copy the left leg
        imagecopyresampled($rendered, $source, 60, $b * 2.5, $s / 2, $s * 2.5, $b / 2, $b * 1.5, $s / 2, $s * 1.5);

// Copy the right leg
        imagecopyresampled($rendered, $fsource, $b * 1, $b * 2.5, $s * 7, $s * 2.5, $b / 2, $b * 1.5, $s / 2, $s * 1.5);
    }

// Output to the browser
    imagepng($rendered);

New skin change

As you noticed, latest snapshots added new things on player skins, that currently my minotar setup doesn't accept it and im not going to use the GO language, im sticking with PHP (I know GO has much performance) but I prefer to stick with PHP. Idk if you ever going to write something to add compatibility to this.

I hope that you would do something on PHP to add compatibility with future 1.8 release.

Thanks

Contact me

Hello,

I tried to contact with this page but it doesn't worked. It gives a error (http://axxim.net/contact)..

Could the owner of this project contact me at daniel [ at ] daannet [ dot ] nl ?

Error 522

Quite a lot of the time recently, the Minotar site has been offline. It's getting to the point where it's very frustrating. Please fix :)

New UUID / new skin changes

Hi, you're probably aware of this, Mojang recentely implemented new skin changes with UUID, so it gonna break all Minotar instances... The ones who have older/newer installs will likely break because of their new skin change. But I guess they wont remove it because of older minecraft versions (beta, official ones)

Just to note: I'm still on PHP frontend and wont move to GO. Tried installing Minotar (go) and I only sees steves.

Idk if any developer knows PHP to load skins via UUID, as of 1.7.8 loads skins from textures.minecraft.net, not on skins.minecraft.net... that gonna kill my skin server >_>

HTTPS Enforcing

Get rid of the HTTPS enforcing. It's stupid for the following reasons:

  • Wastes bandwidth due to additional handshakes.
  • You're not serving any sensitive information. Player skins are public anyway so why care about hiding which skin(s) one is viewing.
  • It's a waste of page load time. Again, HTTPS handshakes take time to take place and therefore it's a stupid thing to do.

How to install?

I would like to install your software on my VPS but i have no Idea how to install it.
May you write a short How To ?

Add Mojang Capes

Feature Request to add a Cape API to Minotar.

Was going to write up a PR but I know nothing about Go :(

Skin won't update/Force update skin (continued)

My head does not display my skin (Username: "Heartburst_") on the Enjin website. Since the last issue (79) was closed, a few heads of others in the community that were working properly are now back to Steves.

Help, vendor is missing!

As you can see under this i missing the vendor folder, could anyone help me with this?

Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in /home/creeperservers/domains/skin.creeperservers.nl/public_html/index.php on line 2
Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in /home/creeperservers/domains/skin.creeperservers.nl/public_html/index.php on line 2
Fatal error: require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/creeperservers/domains/skin.creeperservers.nl/public_html/index.php on line 2

Thanks in advance!

Couple avatars showing just steve instead of premium skin

So i'm working on a website and want to use minotar if the players are logged in on my website.
Could you guys please update and add more skins to our databases.
Thank you already ,
LegendaryNetwork owner of a legendarynetwork server

Use Redis for Skin Caching

Currently we don't know when we last updated a skin in the skin cache, we want to add Redis to Minotar to keep track of this data so we can know when we need to invalidate a specific image.

All are steve.

Title explained. Every user is steve and headers are perfectly fine? Any support?

Steves?

http://avatar.mcbeast.net/
Every skin on there is just shown as a steve, even if the avatar isn't a steve. I'm using usernames for this. You can see the usernames with credits are also the same.

Cache for a day

We want to look over the various places that we cache to make sure we're only caching an image for a day.

We sent HTTP cache headers, skin cache, nginx caches and cloudflare caches.

"500 OK" for "kindari"

http://www.minotar.net/helm/kindari/100.png

Returns 500 OK. Headers:
CF-Cache-Status:MISS
Connection:keep-alive
Content-Type:text/html
Date:Thu, 16 Aug 2012 21:04:41 GMT
Server:cloudflare-nginx
Transfer-Encoding:chunked
Vary:Accept-Encoding
X-Powered-By:PHP/5.3.6-13ubuntu3.8

I'll fork the code and take a look myself after work tonight, but figured I'd report it. His avatar seems to work in game but most avatar/skin viewers seem to break with him.

Skin won't update/Force update skin?

My minecraft skin won't update on minotar, is there any way to force update it?

Or if not, how long does it take (on average) to update it?

My usernames are "greenfrigate" and "greenfrigate_" if you admins have some way of fixing it.

It has updated on minecraft.net and in game, if that helps.

Thanks.

My Head/Skin won’t update

I have a Enjin account for my minecraft server and all of the sudden my minecraft skin when to the old Steve skin and don’t like it that why. Is there any way you can update it that would be very nice.

IGN: Browning98

Old skin

Hi, I've got a problem when I use your system to obtain my head skin's.
If I use : "https://minotar.net/avatar/Goby03"
I've this skin : http://hellyrion.xooit.org/image/96/7/4/6/goby03-3ef3c0a.png.htm
It was an old skin I used.
But my new skin is like that : http://www.planetminecraft.com/skin/iron-man-contest/
It's a bit strange because I changed it a long time ago (more than 2 month).
Is that script is not updated ?

Thanks for your help.


Ps : I'm sorry for spelling errors, I'm not english and I don't speak this language a lot...

Cannot Access Local via HTTPS

Back when this was written in PHP, I hosted this on my own server to reduce the traffic on yours. Since then, I've had a lapse in my server administration duties.

Now that I am actively a server admin again, I went to install Minotar on my server again and noticed it had been switched to go... however when I have the service running on my server, I cannot access a secure version of it. This is an issue when you run SSL on all of your site...

I am currently looking for a solution, could you provide one please? Thank you. :) 👍

Add frontal images

It would be nice if you could create an image of the player's entire body from the front.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.