frosh/platform-thumbnail-processor 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

frosh/platform-thumbnail-processor

Composer 安装命令:

composer require frosh/platform-thumbnail-processor

包简介

This plugins allows you to use variable thumbnails, without having them on storage.

README 文档

README

Software License Shopware Store

This plugin allows you to use variable thumbnails, if your filesystem (or storage-adapter) supports it. So you don't need modern file formats.
Besides the benefits for using it in live shops, you can use this also in development-systems, if you don't want thumbnails to be created.
It will add parameters to original image paths.
So you are able to save storage and add new thumbnails on the fly.

Plugin version Shopware version Branch
5.* Min. 6.6 main
4.* - 3.0.0 Min. 6.5 v4
2.* - 1.0.16 Min. 6.4 v2
1.0.15 - 1.0.6 Min. 6.3
1.0.5 - 1.0.0 Min. 6.0

Install

Download the plugin from the release page and enable it in Shopware.

By composer

composer require frosh/platform-thumbnail-processor

From source

Run npm install in src/Resources/app/storefront within the plugin directory

By zip

download latest release and upload into admin: https://github.com/FriendsOfShopware/FroshPlatformThumbnailProcessor/releases/latest/download/FroshPlatformThumbnailProcessor.zip

Usage

While active, this will access all thumbnails variable from original image. The thumbnail-files won't be needed anymore.

e.g.:
https://www.example.com/thumbnail/01/82/69/sasse_200x200.png
 becomes:
https://www.example.com/media/01/82/69/sasse.png?width=200

You can edit the thumbnail-template within the plugin-config. Defaults {mediaUrl}/{mediaPath}?width={width}. Available variables with examples:

  • {mediaUrl}: https://www.example.com/
  • {mediaPath}: media/01/82/69/sasse.png
  • {width}: 800
  • {mediaUpdatedAt}: 1716882050 (unix timestamp) or 0

Feel free to decorate ThumbnailUrlTemplateInterface to add more individual functions like signed imgproxy

Removing unneeded thumbnails

You may want to delete folder thumbnails within folder public. If needed, you could create redirects on your web server for old paths. Example for Apache .htaccess: RewriteRule ^thumbnail/(.*)_\d+x\d+.(.*)$ https://cdn.myshop.com/media/$1.$2 [L,R=301], consult their docs for more details.

Adding more thumbnail sizes:

  • Save new size in the folder of the media management
  • (no more needed from version 3.0.2) run the command bin/console media:generate-thumbnails on the console to update the thumbnails for all images in the database
  • Clear shop cache

Find Patterns

You can find patterns in GitHub Discussions in category Patterns

Uninstall

After uninstalling plugin you have to run bin/console media:generate-thumbnails --strict to generate the thumbnails-files on disk.

License

The MIT License (MIT). Please see License File for more information.

frosh/platform-thumbnail-processor 适用场景与选型建议

frosh/platform-thumbnail-processor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 114.28k 次下载、GitHub Stars 达 22, 最近一次更新时间为 2019 年 12 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「admin」 「media」 「storage」 「thumbnail」 「backend」 「cdn」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 frosh/platform-thumbnail-processor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 frosh/platform-thumbnail-processor 我们能提供哪些服务?
定制开发 / 二次开发

基于 frosh/platform-thumbnail-processor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 22
  • Watchers: 1
  • Forks: 15
  • 开发语言: PHP

其他信息

  • 授权协议: mit
  • 更新时间: 2019-12-23