PDOCrud Image operations Resize, thumbnail, flip, crop, add overlay(water mark), add text to image (added in v 1.9)

With PDOCrud, you can easily resize images, make thumbnails, flip images, crop images, add overlay (watermark), or add text to images. You need to define the field type as image to make it file control. PDOCrud uses The SimpleImage PHP class to implement all these image related operations.

  
                            $pdocrud = new PDOCrud();
                            //resize image, (width as key and height as value in array)
                            $pdocrud->resizeImage(array("100"=>"100"));
                            //Add overlay image (watermark) - pass overlay image, position, opacity, x_position, y_position
                            $pdocrud->watermark("http://localhost/pdoCrud/demo/pages/images/overlay.png","bottom right","0.8");
                            // Thumbnail Trim the image and resize to exactly width and height given
                            $pdocrud->thumbnailImage(100, 100);
                            //Crop image - x1, y1, x2,y2
                            $pdocrud->crop(5, 20, 100, 400);
                            //flip image (x or y)
                            $pdocrud->flip("x");
                            //Add text on image
                            $pdocrud->imageText('Your Text',  __DIR__.'/images/delicious.ttf', 32, '#FFFFFF', 'top', 0, 20);

                            $pdocrud->fieldTypes("product_image", "image");
                            $pdocrud->formFields(array("product_image","product_id"));
                            echo $pdocrud->dbTable("products")->render("insertform");
                            

Deprecated: Required parameter $field follows optional parameter $op in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 924

Deprecated: Required parameter $task follows optional parameter $op in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 924

Deprecated: Required parameter $totalrecords follows optional parameter $page in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrudHelper.php on line 191

Warning: Trying to access array offset on value of type null in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 3532

Warning: Trying to access array offset on value of type null in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 3543

Warning: Trying to access array offset on value of type null in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 3588

Warning: Trying to access array offset on value of type null in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 4221

Warning: Trying to access array offset on value of type null in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 4230

Warning: Trying to access array offset on value of type null in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 3588

Warning: Trying to access array offset on value of type null in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 4221

Warning: Trying to access array offset on value of type null in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 4230