Instagram API仅返回正方形(已裁剪)图像

编程入门 行业动态 更新时间:2024-10-28 19:21:14
本文介绍了Instagram API仅返回正方形(已裁剪)图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

1年前,Instagram迁移了API以支持横向和纵向格式.

1 year ago Instagram migrated the API to support landscape and portrait formats.

就像上周,api返回了裁剪后的正方形图像.

Looks like last week the api is returning a cropped square image.

示例: www.instagram/p/BHLY4N0jMfA/(图片不是正方形)

Example: www.instagram/p/BHLY4N0jMfA/ (the image is not square)

Api端点( api.instagram/v1/tags/igapitest/media/recent )返回裁剪后的方形图片:

Api endpoint (api.instagram/v1/tags/igapitest/media/recent) returns cropped square image:

... images: { low_resolution: { url: "scontent.cdninstagram/t51.2885-15/s320x320/e35/c224.0.631.631/13556933_1110271362362401_1093314529_n.jpg?ig_cache_key=MTI4MjIyNzkzNTE2NDI4NjkxMg%3D%3D.2.c", width: 320, height: 320 }, thumbnail: { url: "scontent.cdninstagram/t51.2885-15/s150x150/e35/c224.0.631.631/13556933_1110271362362401_1093314529_n.jpg?ig_cache_key=MTI4MjIyNzkzNTE2NDI4NjkxMg%3D%3D.2.c", width: 150, height: 150 }, standard_resolution: { url: "scontent.cdninstagram/t51.2885-15/s480x480/e35/c224.0.631.631/13556933_1110271362362401_1093314529_n.jpg?ig_cache_key=MTI4MjIyNzkzNTE2NDI4NjkxMg%3D%3D.2.c", width: 480, height: 480 } }, ...

即使您尝试使用媒体端点( api.instagram/v1/media/1282227935164286912_189136266 ),它将再次返回裁剪后的正方形图像.

Even if you try the media endpoint (api.instagram/v1/media/1282227935164286912_189136266) it returns cropped square images again.

注意到网络Instagram使用的图像来自API返回的另一个CDN.

Noticed that images used by the web Instagram comes from another cdn than the api returns.

在Instagram API中查找错误?有什么建议吗?

Looks a bug in Instagram API? Any Suggestions?

推荐答案

您是否已在API设置中选中非正方形图像"选项.

Have you checked the option for "Non-square images" in your API settings.

我使用API​​检查了相同的媒体,获得了风景图片.

I checked the same media using my API, I get landscape images.

图像URL相同,只是我的API响应的URL中没有c224.0.631.631/,您可以将其从URL中删除,然后得到未裁剪的图像.但是请检查您的API设置.

The image URL is same except I dont have c224.0.631.631/ in my API response's URLs, you can remove that from your URLs and you will get non-cropped images. But check your API settings.

更多推荐

Instagram API仅返回正方形(已裁剪)图像

本文发布于:2023-07-26 19:02:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1217904.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:正方形   图像   Instagram   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!