Giter VIP home page Giter VIP logo

freshizer's Introduction

Usage

// include freshizer in your php project

include 'freshizer.php';

// not fixed height = false parameter

echo fImg::resize( 'http://domain.com/wp/image.jpg', 200, 200, false );

// fixed height = true parameter

echo fImg::resize( 'http://domain.com/wp/image.jpg', 200, 200, true );

The last two (height and fixed) parameters are optional. This script goes with automated caching, so you will be not overloading your server. Also this script does not even connect to your database, yay :) All images are stored in:

/wp-content/uploads/freshizer/

Retina Support

Freshizer now automatically creates retina version of each image. This retina image has @2x suffix which makes it really easy to implement Retina support with scripts such as retina.js. If the retina.js script detects there is a @2x variant of the same image on your server, it will automatically replace normal image with it's retina variant.

https://github.com/imulus/retinajs

Example:

You upload 1500x1500 photograph and resize it like this to 500x500

echo fImg::resize( 'http://domain.com/wp/photo.jpg', 500, 500, false );

This will create 2 files, one for normal DPI displays and one for Retina displays:

photo.jpg - 500x500
[email protected] - 1000x1000

Example #2:

You upload 300x300 photograph and resize it like this to 200x200

echo fImg::resize( 'http://domain.com/wp/photo.jpg', 200, 200, false );

This will create 2 files, one for normal DPI displays and one for Retina displays:

photo.jpg - 200x200
[email protected] - 400x400 - yes, this image will be slightly blurry but that is the tax for ease of use compared to other solutions where you have to upload normal and retina images seperately

freshizer's People

Contributors

miraff avatar 27bslash6 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.