<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>ImageMetadata | 锤子前端</title><description>Now vibe coding, so learning hammer FE ?</description><link>https://channel.meo-ai.com</link><item><title>《probe-image-size：无需完整下载即可获取图片尺寸》</title><link>https://channel.meo-ai.com/posts/628</link><guid isPermaLink="true">https://channel.meo-ai.com/posts/628</guid><pubDate>Fri, 08 May 2026 03:02:30 GMT</pubDate><content:encoded>&lt;span class=&quot;post-title-source&quot;&gt;《probe-image-size：无需完整下载即可获取图片尺寸》&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;标签：&lt;a href=&quot;/search/result?q=%23NodeJS&quot; title=&quot;#NodeJS&quot;&gt;#NodeJS&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23ImageProcessing&quot; title=&quot;#ImageProcessing&quot;&gt;#ImageProcessing&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23ProbeImageSize&quot; title=&quot;#ProbeImageSize&quot;&gt;#ProbeImageSize&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23StreamParsing&quot; title=&quot;#StreamParsing&quot;&gt;#StreamParsing&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23ImageMetadata&quot; title=&quot;#ImageMetadata&quot;&gt;#ImageMetadata&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23PerformanceOptimization&quot; title=&quot;#PerformanceOptimization&quot;&gt;#PerformanceOptimization&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;总结：&lt;br /&gt;probe-image-size 是一款轻量级 Node.js 库，能在不下载完整图片的情况下快速探测图片尺寸与类型。它支持 URL、Stream 和 Buffer 三种输入方式，覆盖 JPG/PNG/WebP/AVIF/HEIC 等主流格式，通过流式解析仅读取文件头部信息，对大图和远程资源特别省内存、省带宽，是图片预处理场景的理想选择。&lt;br /&gt;&lt;br /&gt;文章要点：&lt;br /&gt;- 支持超多种格式：JPG、GIF、PNG、WebP、BMP、TIFF、SVG、PSD、ICO、AVIF、HEIC、HEIF 统统能读，覆盖面很广&lt;br /&gt;- 流式探测超省资源：不需要把整张大图拉下来，只读取文件头部就能算出宽高，远程大图也能秒开，内存和带宽都友好&lt;br /&gt;- 三种输入方式任选：可以直接传网址自动下载探测，也可以丢文件流或 Buffer 进去，同步异步 API 都有，接入很灵活&lt;br /&gt;- 额外信息一并返回：除了宽高，还会带回图片类型、MIME、方向角（Orientation），ICO 和 AVIF 还能拿到多尺寸变体列表&lt;br /&gt;- 安全提示要记牢：对于不可信来源的图片，返回的宽高值别直接信任，建议在自己的业务里再加一层范围校验&lt;br /&gt;&lt;br /&gt;文章URL：&lt;a href=&quot;https://github.com/nodeca/probe-image-size&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;https://github.com/nodeca/probe-image-size&quot;&gt;https://github.com/nodeca/probe-image-size&lt;/a&gt;&lt;a class=&quot;tgme_widget_message_link_preview&quot; href=&quot;https://github.com/nodeca/probe-image-size&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO. - nodeca/probe-image-size&quot;&gt;
  
  &lt;div class=&quot;link_preview_site_name accent_color&quot;&gt;GitHub&lt;/div&gt;
  &lt;img class=&quot;link_preview_image&quot; alt=&quot;GitHub - nodeca/probe-image-size: Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF,…&quot; src=&quot;/static/https://cdn4.telesco.pe/file/Xx0leOWVoTq_hWL_TJzylhifEcVCOXdqLgM0W_zZLQdfr2OQv_r7aCxmq61aKsXZZSbTX5VGfm2H-qixYla9nimeYn0NorcLFlSu58h5IMB5EnZ6rP0O32fICa7m93VGxRhBVchfvLUZDI287-vZMORxWhKXZGhT6fdV_ztm-IBh9Ep0Ay1eiB4jyqih2XnbkogKlKWt6pNKE5uNBRnressnIq1J8oJCJBcpdaC4ECFb850jaZuFe0ksdvip6phx3olSpLmoCh37iTdhFcPp84pj6--rMsR9x2WFdiUmWjjJze-SRcaa9NCLHeLaHIe3QRyVm3Qe7Txi_W_hsS7sOg.jpg&quot; width=&quot;1200&quot; height=&quot;630&quot; loading=&quot;eager&quot; /&gt;
  &lt;div class=&quot;link_preview_title&quot;&gt;GitHub - nodeca/probe-image-size: Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF,…&lt;/div&gt;
  &lt;div class=&quot;link_preview_description&quot;&gt;Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO. - nodeca/probe-image-size&lt;/div&gt;
&lt;/a&gt;</content:encoded></item></channel></rss>