Yelp API ios getting a larger image

爷,独闯天下 提交于 2019-12-12 17:03:17

问题


I am currently using the Yelp API for my project, and I need to get the image of a business to use as a background, displayed in a UIImageView. However, all the pictures are too small from the pictures obtained, so the background is blurry. I use this code to obtain the current business images:

[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[businessDict objectForKey:@"image_url"]]]];

Is there anyway to obtain a larger image?


回答1:


Replace the filename at the end of the image URL with o.jpg and you'll get up to 1000×1000 pixels. Other sizes are:

  • s.jpg: up to 40×40
  • ss.jpg: 40×40 square
  • m.jpg: up to 100×100
  • ms.jpg: 100×100 square
  • l.jpg: up to 600×400
  • ls.jpg: 250×250 square
  • o.jpg: up to 1000×1000
  • 348s.jpg: 348×348 square


来源:https://stackoverflow.com/questions/17965691/yelp-api-ios-getting-a-larger-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!