compact / angular-bootstrap-lightbox

An AngularJS lightbox built using UI Bootstrap Modal.
http://compact.github.io/angular-bootstrap-lightbox/
MIT License
306 stars 134 forks source link

showing encoded image without url (base64) #39

Closed Dioude closed 8 years ago

Dioude commented 8 years ago

Hello, i'm currently displaying my images using base64_encode so my tag looks like this

div ng-click="openLightboxModal($index)"> img ng-src="data:image/JPEG;base64,{{item.hash}}"

So i got this issue when i click on my image it says "Failed to load image", because i think he wants to load it from a url, which i'm not able to give him to.

Is there a way around ? Or did i missed something ?

Thanks

compact commented 8 years ago

I added a base64 encoded image here and it works: http://compact.github.io/angular-bootstrap-lightbox/demo1/index.html

Make sure the url property of your images have the full data URI and not only item.hash.

When your image fails to load, is there a 404 error in your browser console?

aikrez commented 8 years ago

I can conform the solution of compact. The url of the image needs "data:image/JPEG;base64,"+url instead of just the hash.