lukasz-galka / ngx-gallery

Angular image gallery plugin
https://lukasz-galka.github.io/ngx-gallery-demo/
MIT License
436 stars 171 forks source link

ImageItem: "Unable to load image!" when image exceeds a certain size and takes longer to load. #251

Open richard-mv opened 5 years ago

richard-mv commented 5 years ago

I have two URLs that retrieve the content for the images I want to display on my gallery. One is a URL that returns medium-size images and another one for returning large-size images.

This is how I'm setting up each of my ImageItems within the gallery. new ImageItem({src: '${this.imageURL}/${id}/content', thumb: '${this.imageURL}/${id}/medium/')

These are APIs for fetching the images' content which are exactly the same and only differ in the size of the image that they return. Both of these work just fine and are used in several other places.

When I'm running the gallery the thumbnails always display correctly but most of the main images start loading and then show a message saying "Unable to load image!". If I close the gallery and try to open the same image again it will sometimes load correctly after a few tries. It just seems to timeout when trying to load initially when the image takes longer to load. Also, if I set both the src and the thumb attributes to point to the medium image URL, images load just fine.

I have this in my config and have tried all the possible permutations between loading mode and loadingStrategy. This is the one for which I get more images to load correctly: GalleryModule.withConfig({ loadingMode: 'indeterminate', loadingStrategy: 'lazy', })

lukasz-galka commented 5 years ago

Hi @richard-mv, are you sure you posted question in right repository?