2017 © Pedro Peláez
 

library image-php

This package has the aim of upload images (only gif, jpg and png for now) and resize automatically them according with configuration pre-configured.

image

pluritech/image-php

This package has the aim of upload images (only gif, jpg and png for now) and resize automatically them according with configuration pre-configured.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

pluritech-image-php

Image Upload for PHP from Base 64 (v1)

This repository contains the open source PHP that allows image upload from your PHP app with pre-configured size., (*1)

Installation

The Library can be installed with Composer. Run this command:, (*2)

composer require pluritech/image-php

Usage

Simple use example., (*3)

require_once __DIR__ . '/vendor/autoload.php'; // change path as needed

use ImagePhp\GeneratorImageSDK as GeneratorImageSDK;
use \Exception;
use ImagePhp\Exception\ImageException;

$url_path = //web path where the picture will be uploaded
$dir =  //path where the picture will be uploaded

$config['url']      = $url_path;
$config['dir']           = $dir;
$config['width']         = 650;//pre-configured width to be set on image
$config['height']        = 310;//pre-configured height to be set on image
$config['thumb']         = true;// boolean type - specific if that image has thumb copy image as well
$config['thumb_width']   = 25;//pre-configured width to be set on thumb image
$config['thumb_height']  = 15;//pre-configured height to be set on thumb image
$config['water_mark']    = false;//boolean type - specific if that image will have water mark. If true, the water mark path must be send as second parameter.
$config['transparency']  = false;
$config['square']        = true;// boolean type - specific if that image has square copy image as well
$config['square_width']  = 200;//pre-configured width to be set on square image
$config['square_height'] = 200;//pre-configured height to be set on square image

generatorSDK = new GeneratorImageSDK($config);

try{
    $base64 = 'base 64 here' // on this site you can get 64 base from a image - https://www.base64-image.de/
    $photo = getGenerateImageSDK()->generatePhoto($base64);
    getGenerateImageSDK()->setPicture($photo);         
    $photo = getGenerateImageSDK()->automaticResize();
    getGenerateImageSDK()->setPicture($photo);
    $photo = getGenerateImageSDK()->createImages();


} catch (ImageException $e) {
    $photo['error'] = array(
        "code"        => 'F'.sprintf("%02d", $e->getCode()),
        "status"      => $e->getStatus(),
        "description" => $e->getMessage()
    );

    echo $photo;            
}
catch (Exception $e) {
    $photo['error'] = array(
        "code"        => 'F'.sprintf("%02d", $e->getCode()),
        "status"      => 'PictureError',
        "description" => $e->getMessage()
    );
    echo $photo;            
}
echo $photo;
}




Documentation

In progress., (*4)

Tests

In progress., (*5)

Contributing

Feel free to make your pull request, chip in to suggestion or report issues., (*6)

License

MIT © Guilherme Valentim e Natália Gonçalves Machado, (*7)

The Versions

23/07 2018

dev-master

9999999-dev https://github.com/Pluritech/image-php

This package has the aim of upload images (only gif, jpg and png for now) and resize automatically them according with configuration pre-configured.

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-gd *

 

php images pluritech automatic resize

23/07 2018

1.1.1

1.1.1.0 https://github.com/Pluritech/image-php

This package has the aim of upload images (only gif, jpg and png for now) and resize automatically them according with configuration pre-configured.

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-gd *

 

php images pluritech automatic resize

02/07 2018

1.0.2

1.0.2.0 https://github.com/Pluritech/image-php

This package has the aim of upload images (only gif, jpg and png for now) and resize automatically them according with configuration pre-configured.

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-gd *

 

php images pluritech automatic resize

14/06 2018

1.0.1

1.0.1.0 https://github.com/Pluritech/image-php

This package has the aim of upload images (only gif, jpg and png for now) and resize automatically them according with configuration pre-configured.

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-gd *

 

php images pluritech automatic resize

14/06 2018

1.0.0

1.0.0.0 https://github.com/Pluritech/image-php

This package has the aim of upload images (only gif, jpg and png for now) and resize automatically them according with configuration pre-configured.

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-gd *

 

php images pluritech automatic resize