Giter Club home page Giter Club logo

codeigniter-img's Introduction

CodeIgniter - Img

Simple CodeIgniter library to generate high quality thumbnails


Library is based on excellent * Smarty plugin "Thumb" * created in 2005 by Christoph Erdmann.

My version is a little bit different, I'm using core from Thumb, and some modification which gives me more flexibility to work with it.

Features

  • thumbnails are generated “on the fly” no additional actions required,
  • cache for generated thumbnails,
  • a clear structure for generated thumbnails,
  • thumbnails sharpening function,
  • cropping function,
  • fill space function

INSTALLATION:

Upload img.php file to application/libraries/, upload config/img.php to application/config folder.

USING THE LIBRARY:

Loading library

$this->load->library('img');

In view you can use function with this parameters:

echo $this->img->rimg('assets/img/image.jpg', array('longside' => 745, 'alt' => 'alt text')

Parameters:

longside – width of longest side (pixel value),

shortside – width of shorter side

crop – cropping (true/false)

width – fixed width (with this parameter you need also set height)

height – height (with this parameter you need to also set height)

sharpen – sharp image after scale

nocache – rewrite existing file in the cache

frame - true / false (scale image to exact dimensions + create frame where proption is wrong)

r,g,b - colors for frame background

Feel free to send me an email if you have any problems.

Thanks,

Slawomir Jasinski

[email protected]

@slavomirj

codeigniter-img's People

Contributors

slav123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

codeigniter-img's Issues

Crop image with same dimensions

I've uploaded a picture (sliced from the Photoshop design) so it has the right dimensions already. This is not going to happen in the future when other users are uploading the pictures.
I saw that it's not possible to setup the picture like below:

img->rimg($slider['img'], array('width' => 980, 'height' => 480, 'crop' => true, 'alt' => $slider['label'])); ?>

This because the uploaded image has already the dimensions 980x480. When I upload a new picture with other dimensions the problem is solved.

Could you please help me?

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.