duanjiwei1283 2018-10-10 23:13
浏览 44

API Blogger - 在移动设备上显示图片

I've got a problem by using the Blogger API in PHP. When I publish an article with a picture on Blogger by using API, the picture appeared correctly on desktop version of my blog but no on mobile.

For example:

I send the following article on Blogger

<p><img src="https://cdn.pixabay.com/photo/2018/10/03/21/13/mushroom-3722395_960_720.jpg" /></p><p>Test</p>

On the index of my Blogger on Desktop, the pictures are correctly displayed:

Index Blogger on Desktop

I open the same page on mobile, and all pictures have disappeared:

Index Blogger on Mobile

I noticed that URL generated by Blogger are differents on mobile and desktop.

By inspecting element, the URL on mobile is exactly the same that I've sent thanks to the API (ie: https://cdn.pixabay.com/photo/2018/10/03/21/13/mushroom-3722395_960_720.jpg).

On desktop, the URL is totally different:

https://lh4.googleusercontent.com/proxy/...

If I edit the post directly on Blogger and if I replace the original URL (https://cdn.pixabay.com/photo/2018/10/03/21/13/mushroom-3722395_960_720.jpg) by the URL generated (https://lh4.googleusercontent.com/proxy/...), the picture appeared correctly on mobile!

Have you got an explanation? How I can display pictures on mobile by using this API?

  • 写回答

1条回答 默认 最新

  • dtm37893 2018-10-10 23:49
    关注

    Your blog uses two templates now one for desktop and other for mobile. The mobile template is one of old default blogger mobile templates which allow showing images that hosted on blogger only. Images hosted on blogger can be easily resized by change some values in image URL, that cannot be done with images hosted away off blogger.

    Now you have to change mobile template and aplly the desktop template to cover both desktop and mobile. change mobile template

    评论

报告相同问题?

悬赏问题

  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch