Exemplo n.º 1
0
 protected function createThumbnail($image)
 {
     $thumb = new Thumbnail($image);
     $thumb->setDestination($this->thumbDestination);
     $thumb->setSuffix($this->suffix);
     $thumb->create();
     $messages = $thumb->getMessages();
     $this->messages = array_merge($this->messages, $messages);
 }
Exemplo n.º 2
0
<?php

$folder = 'C:/xampp/htdocs/phpsols/images/';
//$folder = '/Applications/MAMP/htdocs/phpsols/images/';
use PhpSolutions\Image\Thumbnail;
if (isset($_POST['create'])) {
    require_once '../PhpSolutions/Image/Thumbnail.php';
    try {
        $thumb = new Thumbnail($_POST['pix']);
        $thumb->setDestination('C:/upload_test/thumbs/');
        $thumb->setMaxSize(100);
        $thumb->setSuffix('small');
        $thumb->create();
        $messages = $thumb->getMessages();
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
?>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>Create Thumbnail</title>
</head>

<body>
<?php 
if (isset($messages) && !empty($messages)) {
    echo '<ul>';
    foreach ($messages as $message) {
Exemplo n.º 3
0
<?php

$folder = 'C:/xampp/htdocs/phpsols/images/';
//$folder = '/Applications/MAMP/htdocs/phpsols/images/';
use PhpSolutions\Image\Thumbnail;
if (isset($_POST['create'])) {
    require_once '../PhpSolutions/Image/Thumbnail.php';
    try {
        $thumb = new Thumbnail($_POST['pix']);
        $thumb->test();
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
?>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>Create Thumbnail</title>
</head>

<body>
<form method="post" action="">
    <p>
        <select name="pix" id="pix">
            <option value="">Select an image</option>
            <?php 
$files = new FilesystemIterator('../images');
$images = new RegexIterator($files, '/\\.(?:jpg|png|gif)$/i');
foreach ($images as $image) {
Exemplo n.º 4
0
<?php

$folder = 'C:/xampp/htdocs/phpsols/images/';
//$folder = '/Applications/MAMP/htdocs/phpsols/images/';
use PhpSolutions\Image\Thumbnail;
if (isset($_POST['create'])) {
    require_once '../PhpSolutions/Image/Thumbnail.php';
    try {
        $thumb = new Thumbnail($_POST['pix']);
        $thumb->setDestination('C:/upload_test/thumbs/');
        $thumb->setMaxSize(100);
        $thumb->setSuffix('small');
        $thumb->test();
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
?>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>Create Thumbnail</title>
</head>

<body>
<form method="post" action="">
    <p>
        <select name="pix" id="pix">
            <option value="">Select an image</option>
            <?php