We are using MBphoto browse in our mobile app to display list of images in a scroll view. Even though my images are displayed in 200x200 size to fit but the actual image size of 1500x1500 is not getting resized as a result of which images looks distorted. We already have a cropping function on our server, currently url which api provides in this format-
/uploads/listing_assets/listing_1704_1469500655.jpg
but If I change the URL sent from server to this format - /uploads/crop/200x200/listing_assets/listing_1704_1469500655.jpg then I see black images.
Please see this code below-
private func loadImagesFromServer() { let mbView = MBProgressHUD(view: self.view) mbView.mode = .Indeterminate mbView.removeFromSuperViewOnHide = false self.view.addSubview(mbView) let signal: SignalProducer<[String],NSError> = request(.GET, requestUrl: ListingAssetRestApi.List(self.listingId!, self.maxLimit)) .map{ var list = [String]() for(key,asset):(String,JSON) in $0["assets"] { list.append(asset["file_url"].stringValue) } return list } mbView.show(true) signal.startWithNext{ [weak self,weak mbView] in let list:[String] = $0 mbView?.hide(true) self?.items = list self?.collectionView?.reloadData() } }
Hello,
We are using MBphoto browse in our mobile app to display list of images in a scroll view. Even though my images are displayed in 200x200 size to fit but the actual image size of 1500x1500 is not getting resized as a result of which images looks distorted. We already have a cropping function on our server, currently url which api provides in this format- /uploads/listing_assets/listing_1704_1469500655.jpg
but If I change the URL sent from server to this format - /uploads/crop/200x200/listing_assets/listing_1704_1469500655.jpg then I see black images.
Please see this code below-
private func loadImagesFromServer() { let mbView = MBProgressHUD(view: self.view) mbView.mode = .Indeterminate mbView.removeFromSuperViewOnHide = false self.view.addSubview(mbView) let signal: SignalProducer<[String],NSError> = request(.GET, requestUrl: ListingAssetRestApi.List(self.listingId!, self.maxLimit)) .map{ var list = [String]() for(key,asset):(String,JSON) in $0["assets"] { list.append(asset["file_url"].stringValue) } return list } mbView.show(true) signal.startWithNext{ [weak self,weak mbView] in let list:[String] = $0 mbView?.hide(true) self?.items = list self?.collectionView?.reloadData() } }