本文介绍了Yelp API ios 获取更大的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前正在将 Yelp API 用于我的项目,我需要获取要用作背景的企业图像,并显示在 UIImageView 中.但是,从得到的图片来看,所有的图片都太小了,所以背景很模糊.我使用此代码获取当前的商业图片:
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?
推荐答案
将图片 URL 末尾的文件名替换为 o.jpg
,您将获得 1000×1000 像素.其他尺寸为:
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
:最大 40×40ss.jpg
:40×40 平方m.jpg
:最大 100×100ms.jpg
:100×100 平方l.jpg
:最大600×400ls.jpg
:250×250 平方o.jpg
:最大1000×1000348s.jpg
:348×348 平方
s.jpg
: up to 40×40ss.jpg
: 40×40 squarem.jpg
: up to 100×100ms.jpg
: 100×100 squarel.jpg
: up to 600×400ls.jpg
: 250×250 squareo.jpg
: up to 1000×1000348s.jpg
: 348×348 square
这篇关于Yelp API ios 获取更大的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!