GitXplorerGitXplorer
b

squarifier

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
16c55cc3a3f5b463bda84a2cf4d697a5b49a20b7

Update deps

bbemyak committed 2 years ago
Unverified
1ffc525c003764c45c44d58cf6279b9f37db1175

Update deps and blog link

committed 4 years ago
Unverified
aaa22eb77a9f56467dc2b4fc45e7b5c527ed567e

Bump deps

committed 4 years ago
Unverified
b8901655b2fde5ed6c66a66a7e56a712fa38bf25

Update deps

committed 4 years ago
Unverified
e2835938359af1032eb109d3b8c9c0b53c490fde

Update README with new URL

committed 4 years ago
Unverified
ec8e8e1cbaa9aae877cfad8c17de43207c412535

Update deps

committed 4 years ago

README

The README file for this repository.

Token Squarifier

This is a tiny project that help me run my D&D and Pathfinder games at Roll20.

Where?

You can try it at https://squarifier.ml

What?

In short, it dynamically turns this:

Qurashith

into this:

Squarified Qurashith

The image got cropped and made into a square.

Why?

There are few problems with Roll20 that I was constantly facing:

  1. Too small storage (100 Mb for images)
  2. When you insert non-rectangular token, it gets stretched in order to fill the square

I found the solution for the first problem, which is described at the end of my blog post Rolling like a Pro. In short, I'm now able to insert images as links, which doesn't eat any space at all.

But now the second problem got much more worse: you rarely can find a square image on the internet, so you need to download it, crop, make square and this nullifies any win from the #1, because you don't have an image URL now, and you need to upload it again.

To solve this, this project was created. It acts like a proxy that changes your images in the way you'd probably want it: cropped and square. 🎉

How?

We need to process images really quickly in order to be able to respond as fast as possible. We still need to:

  1. Get the request
  2. Download requested image, while the incoming request is waiting
  3. Process it
  4. Answer the request with a processed image

So, the overall latency is around 2 * original_request_latency

To minimize it further you can run Squarifier locally or on some nearby server that has public IP and/or DNS name. To see how the infrastructure is set up, check my infrastructure repository.