dcohenb / angular-img-fallback

Utility to work with loading images, has fallback-src to handle erros in image loading and loading-src for images loading placeholders
MIT License
146 stars 34 forks source link

remove base-64 code #24

Closed diegoarcega closed 8 years ago

diegoarcega commented 8 years ago

It is huge, make the loadingDefault and missingDefault configurable with a provider instead.

with base-64 angular.dcb-img-fallback.js (25,8kb)

without base-64 angular.dcb-img-fallback.js (1,8kb)

dcohenb commented 8 years ago

@diegoarcega You are defiantly right! this was done as a necessity when I first wrote the plugin. but changing this now will defiantly not be backwards compatible.

what do you think, add another slim version angular.dcb-img-fallback.slim.js of the directive or redo it in a new non backwards compatible version?

diegoarcega commented 8 years ago

I believe the slim version is better, so we can choose which one to pick.

One option is to swap that base64 for this 1px transparent "image": var missingDefault = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";

Definitively we should have that mate. Thanks for the great work there, the directive is just great :)

dcohenb commented 8 years ago

@diegoarcega I've released an update where the base64 is significantly minified. It's should be a lot less noticeable now.. I'd appreciate your feedback