purplespider/silverstripe-clearer-thumbnails 问题修复 & 功能扩展

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

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

purplespider/silverstripe-clearer-thumbnails

最新稳定版本:1.0.3

Composer 安装命令:

composer require purplespider/silverstripe-clearer-thumbnails

包简介

Makes CMS and UploadField thumbnails clearer

README 文档

README

This module fixes an issue in Silverstripe 4, 5 and 6 which results in particularly tall or wide images having pixelated/blurry thumbnails in the CMS, particularly for UploadFields.

Before:

Screenshot 2021-08-06 at 09 24 31@2x

After:

Screenshot 2021-08-06 at 09 29 37@2x

It also increases the size of thumbnail images to ensure they remain crips on HiDPI/Retina displays.

Installation

  1. Install module via composer:
composer require purplespider/silverstripe-clearer-thumbnails "1.*"
  1. Perform a flush:
https://www.example.com?flush=1
  1. For Silverstripe 4: For sites with existing assets, run the generate-cms-thumbnails task to re-generate the thumbnails for the Files tab (otherwise no thumbnails will appear).
php vendor/silverstripe/framework/cli-script.php dev/tasks/MigrateFileTask only=generate-cms-thumbnails

Silverstripe 5 doesn't provide the MigrateFileTask anymore.

What exactly does this do?

It simply overrides some settings via a config file to:

  1. Change ThumbnailGenerator $method from FitMax to Fill which avoids thumbnails being generated too small and then stretched.
  2. Doubles the UploadField $thumbnail_width and $thumbnail_height from 60 to 120 to ensure thumbnails are crisp on HiDPI/Retina displays.
  3. Increases the Image $asset_preview_width and $asset_preview_height to ensure image previews in the Files area are crisp on HiDPI/Retina displays.

Notes/Tips

  • On sites with lots of images, the migration task is a resource intensive process which can take a while. Use cpulimit to limit the effect it has on the site, e.g. cpulimit -p 1234 -l 50
  • Possible issue with assets in a symlinked location not getting updated via the migration task, suggest temporarily replacing the symlink with the assets dir before running the task if you experience this.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-08-06