Giter Site home page Giter Site logo

image.php's Introduction

Smart Image Resizer

Resizes images, intelligently sharpens, crops based on width:height ratios, color fills transparent GIFs and PNGs, and caches variations for optimal performance

Created by: Joe Lencioni (http://shiftingpixel.com) Date: August 6, 2008 Based on: http://veryraw.com/history/2005/03/image-resizing-with-php/

Updated By: Nate Nolting ([email protected])

LICENSE

"I love to hear when my work is being used, so if you decide to use this, feel encouraged to send me an email. Smart Image Resizer is released under a Creative Commons Attribution-Share Alike 3.0 United States license (http://creativecommons.org/licenses/by-sa/3.0/us/). All I ask is that you include a link back to Shifting Pixel (either this page or shiftingpixel.com), but don't worry about including a big link on each page if you don't want to; one will do just nicely. Feel free to contact me to discuss any specifics ([email protected])." -- Joe Lencioni

REQUIREMENTS

  • PHP
  • GD

INSTALL VIA BOWER

    bower install image-php#1.4.5 -S

PARAMETERS

Parameters need to be passed in through the URL's query string:

Param Description
image absolute path of local image starting with "/" (e.g. /images/toast.jpg)
width maximum width of final image in pixels (e.g. 700)
height maximum height of final image in pixels (e.g. 700)
color (optional) background hex color for filling transparent PNGs (e.g. 900 or 16a942)
cropratio (optional) ratio of width to height to crop final image (e.g. 1:1 or 3:2)
nocache (optional) does not read image from the cache
quality (optional, 0-100, default: 90) quality of output image

EXAMPLES

Resizing a JPEG:

<img src="/image.php/image-name.jpg?width=100&amp;height=100&amp;image=/path/to/image.jpg" alt="Don't forget your alt text" />

Resizing and cropping a JPEG into a square:

<img src="/image.php/image-name.jpg?width=100&amp;height=100&amp;cropratio=1:1&amp;image=/path/to/image.jpg" alt="Don't forget your alt text" />

Matting a PNG with #990000:

<img src="/image.php/image-name.png?color=900&amp;image=/path/to/image.png" alt="Don't forget your alt text" />

image.php's People

Contributors

d3n1c1d3 avatar natenolting avatar paulbunyannet avatar romanmartushev avatar sskylar avatar

Stargazers

 avatar  avatar

Watchers

 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.