Coder Social home page Coder Social logo

php-simpleimage's Introduction

PHP-SimpleImage

Simple Image manipulation class written by Simon Jarvis and updated with some new methods (I don't remember which, two years old...)

Methods :

load

/**
 * Loads an image
 *
 * @param string $filename Image to load
 * @return boolean True in case of success, false on failure.
 */
function load($filename){}

save

/**
 * Saves an image
 *
 * @param string $filename Image file name
 * @param boolean $original Save the original image if true, modified if false.
 * @param string $image_type Image format
 * @param integer $compression Compression rate (mainly for Jpgs)
 * @param integer $permissions Permissions for the new file
 *
 * @return boolean True in case of success, false on failure.
 */
function save($filename, $original = false, $image_type = null, $compression = 75, $permissions = null){}

output

/**
 * Returns the image without saving it. Useful for direct rendering
 *
 * @param string $image_type Image format
 * @param boolean $original Display original image if true, modified image if false.
 *
 * @return void
 */
function output($image_type = IMAGETYPE_JPEG, $original = true) {}

getWidth

/**
 * Gets the image width
 *
 * @return integer Image width
 */
function getWidth() {}

getHeight

/**
 * Gets the current image height
 *
 * @returns integer image height
 */
function getHeight() {}

resizeToHeight

/**
 * Resize image to desired height. Width will be resized with a ratio.
 *
 * @param integer $height Desired height
 *
 * @return void
 */
function resizeToHeight($height) {}

resizeToWidth

/**
 * Resize image to desired width. Height will be resized with a ratio.
 *
 * @param integer $width Desired width
 *
 * @return void
 */
function resizeToWidth($width) {}

scale

/**
 * Resize an image using a certain scale.
 *
 * @param integer $scale Scale factor
 *
 * @return void
 */
function scale($scale) {}

resize

/**
 * Resize image to given width and height
 *
 * @param integer $width Desired width
 * @param integer $height Desired height
 *
 * @return void
 */
function resize($width, $height) {}

###crop

/**
 * Crops the current image to the desired dimensions
 *
 * @param integer $width Desired width
 * @param integer $height Desired height
 * @param integer $startX Crop horizontal start point
 * @param integer $startY Crop vertical start point
 *
 * @return void
 */
function crop($width, $height, $startX = 0, $startY = 0) {}

###centerCrop

/**
 * Center crops an image to the desired width and height.
 * The cropped image will be in the center of the original image.
 *
 * @param integer $width Image width, in pixels
 * @param integer $height Image height, in pixels
 *
 * @return void
 */
function centerCrop($width, $height) {}

log

/**
 * Adds a message to the modification log
 *
 * @param string $message Message to add
 */
function log($message) {}

reset

/**
 * Resets the current image to original image.
 *
 * @return boolean
 */
function reset() {}

waterMark

/**
 * Watermarks an image
 *
 * @param string $source Watermark image path
 * @param string $position Position on image (can be top-left, top right, bottom-right, bottom-left)
 */
function waterMark($source, $position = 'bottom-left', $type = 'hover', $options = array()) {}

centerCropFull

function centerCropFull($width, $height) {}

cropFull

function cropFull($width, $height) {}
/**
 * Returns the log array.
 *
 * @return array
 */
function getLog() {}

resizeSmallestTo

/**
 * Resize the image, based on th smallest side.
 *
 * @param integer $size Desired size for the smallest side
 *
 * @return void
 */
function resizeSmallestTo($size) {}

resizeBiggestTo

/**
 * Resize the image, based on th biggest side.
 *
 * @param integer $size Desired size for the biggest side
 */
function resizeBiggestTo($size) {}

### rotate

/**
 * Rotates an image
 *
 * @param integer $angle Desired angle to rotate (clockwise)
 */
function rotate($angle = 90) {}

### rotateTo

/**
 * Rotates an image horizontally or vertically
 *
 * @param string $direction 'x' for horizontal (default), 'y' for vertical
 */
 function rotateTo($direction = 'x') {}

php-simpleimage's People

Contributors

mtancoigne avatar

Watchers

ProjeMan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.