Gregwar / Image

A PHP library to handle images
MIT License
1k stars 191 forks source link

Manage other units for print #159

Open clemdesign opened 5 years ago

clemdesign commented 5 years ago

I propose this work in order to:

It allow the user to manage picture for print according the resolution.

Example:

    $image = $this->open('monalisa.jpg');
    $image->init();

    $resolution = $image->getResolution();

    // Save the picture for 6 cm print
    $image
        ->cropResize(Converter::cmToPixels($resolution[0], 6), Converter::cmToPixels($resolution[1], 6))
        ->save($pathToJpgFile);

Tests and Readme of project is updated.