Closed tiexo closed 6 years ago
@tiexo If you can specify Width and Height of the image, you can skip. For example, please write the following code in markdown.
<img src="https://obbuo9upd.qnssl.com/20160304201650.jpg" width="1024" data-height="683" alt="your image">
In AMP HTML, it is necessary to specify the width and height of the image. The plug-in tries to acquire the width and height of the image, but if you can not access the image, you will get this kind of error.
@tea3 Well, I've already understood what you mean.But I want to know, does this error affect the generation and collection of AMP pages? Maybe I can ignore it directly.
@tiexo
This error doesn't affect the generation AMP pages. But is it OK to ignore the width and height of amp-img
? How do you specify width and height ?
https://www.ampproject.org/ja/docs/reference/components/amp-img
@tea3
I didn't define the width and height of the picture.
But I found that plug-ins do not seem to recognize webp image processing style
, resulting in amp pages do not display processed pictures.
Article links: https://www.tiexo.cn/gitalk/amp/ Pre processing picture links: https://obbuo9upd.qnssl.com/20170913195137.png Post processing link: https://obbuo9upd.qnssl.com/20170913195137.png?imageMogr2/format/webp
In the amp web page source code: <p><!-- This img tag couldn't replace. src: <img src="https://obbuo9upd.qnssl.com/20170913195137.png?imageMogr2/format/webp" alt="">--></p>
The article that does not use the webp style is normal,for example: https://www.tiexo.cn/sinaimg/amp/
From the above results, there seems to be no problem in ignoring the width and height of the picture, but there is a new problem now that the plug-in can't identify the webp image processing style
.
Supplement: the so-called webp image processing style
is added ?imageMogr2/format/webp
after the image link, so that the image of the front end request will become webp format.
@tiexo I've understood that you wanted to support webp.
This plugin depend on img-size. The image size is acquired using img-size.
https://github.com/tea3/hexo-generator-amp/blob/master/lib/imageSize.js#L53 https://github.com/tea3/hexo-generator-amp/blob/master/lib/imageSize.js#L110
So, if you can recognize webp with image-size you may be able to solve it.
@tea3 Thank you. It seems too hard for me. Let's put it on hold for a while.
When I run hexo g, plugins will make mistakes.
Because the pictures in my article are all stored on the drawing bed, so plug-ins can't be detected, can you skip this detection process, thank you.