承接 huoxin/auto-image-dimensions 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

huoxin/auto-image-dimensions

Composer 安装命令:

composer require huoxin/auto-image-dimensions

包简介

Automatically fetches and applies width and height dimensions to Flarum image tags to prevent layout shift (CLS).

关键字:

README 文档

README

License Latest Stable Version Total Downloads Review Review Score

A Flarum extension that automatically fetches and applies width and height dimensions to all <img> tags in your forum posts.

By hardcoding the dimensions into the parsed XML of the posts, this extension eliminates Cumulative Layout Shift (CLS), dramatically improving your forum's page performance scores and scrolling experience.

Features

  • Smart Processing: Uses highly optimized HTTP streams (via FastImageSize) to only download the header bytes of remote images, drastically reducing memory and bandwidth overhead.
  • Dynamic Operating Modes: Choose how the extension extracts dimensions based on your server resources:
    • Client Mode (Default): Forum visitors automatically detect image dimensions in their browser and silently report them back to the server. Best for heavily cached or low-resource servers.
    • Backend Mode: The server uses a background Queue Worker to fetch dimensions every time a post is created or edited.
    • Hybrid Mode: Combines both approaches for maximum coverage.
  • Data Integrity: Implements robust Optimistic Locking to ensure background workers never overwrite concurrent user edits.
  • Network Proxy Support: Configurable proxy settings (e.g. tcp://10.0.0.5:3128) for servers behind corporate firewalls.
  • Scheduled Backfills: Automatically retry failed image fetching on a daily, weekly, or monthly cron schedule.

Installation

Install with composer:

composer require huoxin/auto-image-dimensions:"*"

CLI Commands

If you have thousands of existing posts, you can manually trigger a backfill from the command line:

# Fetch dimensions for ALL images that don't have them
php flarum image-dimensions:backfill

# ONLY retry images that previously failed (e.g. due to 404s or timeouts)
php flarum image-dimensions:backfill --retry-failed

Updating

composer update huoxin/auto-image-dimensions:"*"
php flarum migrate
php flarum cache:clear

Links

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固