Skip to content

Simple tool for creating previews of images.

License

Notifications You must be signed in to change notification settings

happyproff/kartinki

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kartinki

Simple tool for creating previews of images.

Latest Stable Version Build Status Scrutinizer Code Quality SensioLabsInsight

Installing

  • Add "happyproff/kartinki": "*" to composer.json.
  • Run composer install

Simple usage example

For example, filename.jpg is 1600x1200.

<?php
use happyproff\Kartinki\Kartinki;

$thumbnails = (new Kartinki)->createImageVersions(
    '/path/to/image/filename.jpg',
    [
        'square' => '200x200',
        'normal' => '400x400:fit',
        'big'    => '1280x720:fit,quality=100',
    ],
    '/output/dir' // optional
);

Kartinki will place 3 files to /output/dir:

1ceebb2cf4b0425a0ea1e1cb49810a07_square.jpg // 200x200
1ceebb2cf4b0425a0ea1e1cb49810a07_normal.jpg // 400x300
1ceebb2cf4b0425a0ea1e1cb49810a07_big.jpg    // 960x720

And $thumbnails will contain:

<?php
[
    'square' => '1ceebb2cf4b0425a0ea1e1cb49810a07_square.jpg',
    'normal' => '1ceebb2cf4b0425a0ea1e1cb49810a07_normal.jpg',
    'big'    => '1ceebb2cf4b0425a0ea1e1cb49810a07_big.jpg'
]

About

Simple tool for creating previews of images.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%