myPortal CMS - the web design community
  • MyPortal 2.0
  • download
  • demo
  • manual
  • editor
  • faq
  • blog
  • forum

free account: Click here
Username: Password:

Manual

img.class.php

Manage images

Usage:

// INITIALIZATION
$img = new img($sourcefile);
$img->load_from_string($data,$mime);
$img->resize($width, $height, $crop, $limitsize=9999); // crop 1 or 0
$img->setBgColor($backgroundColor = '000000'); // hex HTML color
$img->destroy();
$img->quality($quality); // JPEG quality
$img->orientation(); // returns 'landscape' or 'portrait'
$img->size(); // returns size of image
$img->sharpen();
 
// image size and mask size as array(x, y)
// position as string 'top,middle', 'top,right', 'middle,left', 'middle', 'middle,right', 'bottom,left', 'bottom,middle', 'bottom,right'
$img->mask_position($isize,$msize,$position); // returns array($left, $top);
$img->mask($pngimage, $left = 0, $top = 0);
 
$img->forceToJpg();
$img->data(); // outputs imagejpeg or imagegif or imagepng
$img->imgdata(); // returns image data as string
$img->show(); // returns image data with headers
$img->store($file); // stores image to file

Try myPortal 2: