tea3 / hexo-generator-amp

AMP ⚡ HTML (Accelerated Mobile Pages) generator for Hexo.
MIT License
125 stars 28 forks source link

Error: unable to verify the first certificate #38

Closed tiexo closed 6 years ago

tiexo commented 6 years ago

When I run hexo g, plugins will make mistakes.

-> _posts/nofollow-301.md
[17:31:38.027] [hexo-generator-amp] error:  Error: unable to verify the first certificate
This plugin checks whether the image URL exists.
img path: https://obbuo9upd.qnssl.com/20160304201650.jpg
Please check the following file.

-> _posts/where-is-community.md
[17:31:38.027] [hexo-generator-amp] error:  This plugin can not acquire the width and height of such url images. Please change the URL to HTTP or HTTPS, or add height and width.
img path: https://obbuo9upd.qnssl.com/20160304201650.jpg
Please check the following file.

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.

tea3 commented 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.

tiexo commented 6 years ago

@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.

tea3 commented 6 years ago

@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

tiexo commented 6 years ago

@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.

tea3 commented 6 years ago

@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.

https://github.com/image-size/image-size/blob/40c628d26aa6c8600a8f122fef5a33f8c0a8adb2/lib/types/webp.js#L5

tiexo commented 6 years ago

@tea3 Thank you. It seems too hard for me. Let's put it on hold for a while.