承接 sunnysideup/silverstripe-scaled-uploads 相关项目开发

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

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

sunnysideup/silverstripe-scaled-uploads

Composer 安装命令:

composer require sunnysideup/silverstripe-scaled-uploads

包简介

Automatically scale down and rotate uploaded images for Silverstripe. This module is based on axllent's version.

README 文档

README

Reduce your footprint!

For all newly uploaded images in Silverstripe, this extension will automatically scale down (reduce width / height), compress, and convert them to webp to ensure your images are as light as possible, without significantly affecting quality.

history

This module was originally created by Axllent. We rewrote it to match our needs and it ended up so different now from the original module that our pull request did much sense anymore.

Requirements

  • Silverstripe ^4.0 || ^5.0

Usage

Simply install the module and then set your own limits. For setting your limtis please refer to the Configuration.md file.

To use the functionality somewhere else, you can do something like this:

use Sunnysideup\ScaledUploads\Api\Resizer;
use SilverStripe\Assets\Image;

$runner = Resizer::create()
    ->setMaxHeight(100)
    ->setMaxFileSizeInMb(0.6)
    ->setDryRun(true)
    ->setVerbose(true);

$imagesIds = Image::get()->sort(['ID' => 'DESC'])->columnUnique();
foreach ($imagesIds as $imageID) {
    $image = Image::get()->byID($imageID);
    if ($image->exists()) {
        $runner->runFromDbFile($image);
    }
}

Installation

composer require sunnysideup/silverstripe-scaled-uploads

Batch process existing images

If you would like to batch process existing images then you can use the Resize All Images Module that extends this module.

Providing more guidance to the user when uploading images

Use the Perfect CMS Images Module to provide more guidance to the user when uploading images.

Rotation

This extension no longer supports auto-rotation of JPG images (i.e. portrait images taken with digital cameras or cellphones). However, this should now also be part of Silverstripe core functionality if you are using ImageMagick instead of GD - see vendor/silverstripe/assets/src/InterventionBackend.php:278 (not sure if or how this works).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固