GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - EscapeWork/Resize: Easy resize images

BranchesTags
Open more actions menu

Latest commit

 

History

42 Commits
42 Commits

Folders and files

NameName
Last commit message
Last commit date
src/EscapeWork/Resize
src/EscapeWork/Resize
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
composer.json
composer.json
 
 
composer.lock
composer.lock
 
 
phpunit.xml
phpunit.xml
 
 
readme.md
readme.md
 
 

Repository files navigation

EscapeWork\Resize Build Status Latest Stable Version Total Downloads

THIS LIBRARY IS NOT MANITAINED ANYMORE

Componente que faz uma abstração da library Imagine para fazer manipulações com imagens.

Exemplos

use EscapeWork\Resize\Resize;

$resize = new Resize('/path/to/image.jpg');
$resize->setWidth(200)->setHeight(100)->resize(); # ajusta o tamanho automáticamente, mantendo no máximo 200px de largura e/ou 100px de altura

$resize = new Resize('/path/to/image.jpg');
$resize->setWidth(90)->setHeight(90)->crop(); # redimensiona, e depois cropa exatamente 90x90, podendo cortar algumas partes da imagem

Crop a partir de um X e Y definidos

$resize = new Resize('/path/to/image.jpg');
$resize->setX(20)->setY(30)->setWidth(300)->setHeight(400)->crop();

Minimum Width and Minimum Height

$resize = new Resize('/path/to/image.jpg');
$resize->setMinWidth(300)->setMinHeight(500)->resize();

$resize = new Resize('/path/to/other/image.jpg');
$resize->setMinHeight(549)->resize();

$resize = new Resize('/path/to/another/image.jpg');
$resize->setMinWidth(300)->resize();

Upload de arquivos

use EscapeWork\Resize\Upload;

$upload = new Upload($original, $newFile);

Upload e redimensionamento a partir de um array

use EscapeWork\Resize\Resize;

$dir      = 'img';
$img      = 'original.jpg';
$sizes    = array(
    'mini-' => array(
        'width'  => 80, 
        'height' => 80, 
        'crop'   => true
    ), 
    'thumb-' => array(
        'width'  => 150, 
        'height' => 100, 
        'crop'   => false
    ), 
    'vga-' => array(
        'width'  => 640, 
        'height' => 480, 
        'crop'   => false
    ), 
);

# cria 3 novas imagens [mini-original.jpg], [thumb-original.jpg], [vga-original.jpg], 
# redimensionadas e cropadas conforme as informações do array 
Resize::make( $dir, $img, $sizes );

Instalação

A instalação está disponível via Composer.

{
    "require": {
        "escapework/resize": "0.5.*"
    }
}

About

Easy resize images

Resources

Readme
Activity
Custom properties

Stars

4 stars

Watchers

7 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.