     //MARK: -  UICollectionViewDelegateFlowLayout
     
     public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
-        let height = collectionView.bounds.height
-        let tmpImageinfo = imageInformationDic[indexPath.row]
-        
-        guard let imageinfo = tmpImageinfo else {
-            return CGSize(width: 0, height: 0)
-        }
-        
-        let imageSize = imageinfo.size
-        let imageWidth = imageSize.width / imageSize.height * (height - 16)
-        let width = imageWidth + 16
-        
-        return CGSize(width: width , height: height)
+        return self.finalSize
     }
     
     

    
    var retryTimes = 0
    
    
    override public func viewDidLoad() {
        super.viewDidLoad()

                }
                
                if loadedCount == count {
                    var sampleSize = CGSize.zero
                    for  (_, inform) in self.imageInformationDic {
                        if inform.size.height > inform.size.width {
                            self.isVertical = true
                        }
                        sampleSize = inform.size
                    }
                    if self.isVertical {
                        let height = self.collectionView!.bounds.height - 16
                        let scale = sampleSize.width / sampleSize.height
                        let width =  height * scale
                        self.finalSize = CGSize(width: width, height: height)
                    }
                    else {
                        let width = UIScreen.main.bounds.width
                        let scale = sampleSize.height / sampleSize.width
                        let height = width * scale
                        self.finalSize = CGSize(width: width, height: height)
                    }
                    
                    if let imageLoadCompleteBlock = self.imageLoadCompleteBlock {
                        imageLoadCompleteBlock(self.isVertical,self.finalSize)
                    }
                    self.collectionView?.reloadData()
                }
                else {
