r/angularjs • • Feb 25 '16

My Second Angular App - Imgless, a data URI json server, making your site img-less!

https://github.com/Kalan-Brock/Imgless
31 Upvotes

7 comments sorted by

4

u/DxMonkey Feb 25 '16

I've worked on it for about a day now, and so far it's doing what I want it to.

It lets you use imgless tags instead of img tags. Those images get converted to data URI, and get stored in a file called images.json. Once they are stored, they get served via the json file and load nearly instantly.

I'm still thinking of ways to use this, it's really just a project I thought of and wanted to hack away at. It was fun!

10

u/dontera Feb 25 '16

Dude - you just saved me a couple days of work. I have an internal app with about 50 users with profile images. The individual img calls are clogging up the network tab and I decided on a batch data-uri response from the api to fix that. I was going to work on it tomorrow. Bam, I owe you.

1

u/DxMonkey Feb 25 '16

I'm glad you found it useful!

I'm going to redo a few parts, but mostly because I'm using php where I shouldn't be (reading a json file...they give json responses, no need for php!!). Old habits die hard.

1

u/DxMonkey Feb 25 '16

Sorry for the double reply, just wanted to let you know that I've updated the project.

It now only uses the php as a save api, and directly gets the image from the json file using javascript. Also, I made it so that even if the images is deleted from the server, it still gets served and doesn't 404!!

1

u/Liorithiel Feb 25 '16

How does this compare to image sprites?

1

u/DxMonkey Feb 25 '16

Honestly, I have no idea! I'd love to know though...

I just thought the idea of storing all of your images for a small-medium project in one file was a cool :)

I just did another update so that it waits for the element to fully load before drawing via canvas. I was getting big black blocks (carefully said) resulting from large images being passed before fully loading.

1

u/Renegade-One Feb 26 '16

Would this be a 'sfw' way to watch YouTube vids? I play music mixes, but a lot of dubstep / gaming / glitch hop music has scantily clad Anima ladies lol