Yii 1.1: justintimeimageresizer

Create resized images and thumbnail only first time is needed
13 followers

Description

This extension resize images and thumbnail only if resized image or his thumbnail not exists. This means that you can upload images without take care of dimensions of "big" image or "thumb". Not only this!!! If you need to change dimensions of all images or all thumb, just change configuration file. When an image will be called. EJustInTimeR will resize it.

Install

Create this structure folders:

/images
    /jitr
        /originals - this is folder of original images
        /big       - this is folder of rezized big image
        /thumb     - this is folder of resized thumb image

Usage

Put all images in /images/jitr/originals. If the image to resize is called "italy.png" Just call

<?php $this->widget('ext.justintimer.EJustInTimeR', array(
    'image' => 'italy.png'
)); ?>

By default, it is displayed the thumbnail.

Requirements

  • Yii 1.1 orvabove
  • PHP 5.3
  • image (yii extension)

Important!!

Leave images in originals folder. If customer need to change all images dimensions ... just delete images in big and thumb folder. Them will be generated just in time the first time that some one request it.

Display thumbnail

<?php $this->widget('ext.justintimer.EJustInTimeR', array(
    'image' => 'italy.png'
)); ?>

Display big image

<?php $this->widget('ext.justintimer.EJustInTimeR', array(
    'image' => 'italy.png',
    'display' => 'big'
)); ?>

Set title or alt

<?php $this->widget('ext.justintimer.EJustInTimeR', array(
    'image' => 'italy.png',
    'alt' => 'This is alt value =)'
)); ?>

Total 16 comments

#11692 report it
sensorario at 2013/01/27 05:07pm
Working on version 2.0

I am working on a new version of this extension. It will be completely rewritten. I'll remove "image" extension dependency, and I'll suggest some trick to use the extension. Also, I hate name "justintimeimageresizer", maybe I'll change it.

#10713 report it
Nathan at 2012/11/18 09:39am
Arbitrary sizes

Does it have to only be "big" or "thumb"? What if I have like 5 different sizes, will it work?

Also, would it work with remote HTTP files?

#8371 report it
Sampa at 2012/05/29 08:55am
With fancybox

Here is a demo with this extension,fancybox and even xupload http://www.yiiframework.com/forum/index.php/topic/28368-yii-demo-with-automated-gallery/

But the xupload is not updated in that demo,but there is info about how to fix that in the xupload extension forum thread.

#8357 report it
sensorario at 2012/05/28 05:01pm
this project is on github

For any issues or any pull request ...

#8356 report it
gb5256 at 2012/05/28 04:56pm
Hey Drini, could you share all of your code?1

Hello DRINI, you mentioned that you made it possible to use the fancybox. Here:Your text to link here... But if I use your code, I get errors that TARGET is not in fanybox. It seems like you have modified also that one. Could you share your changes to the code? Thanks.

#8347 report it
gb5256 at 2012/05/28 05:19am
Did anybody use this with a lightbox?

Hello out there, this extension is exactly what I was looking for, allowing me to change sizes when ever I want without re-doing all the images. Perfect. My next step is to use something like Fancybox, or PrettyBox.

Is there anybody who can confirm that this works togehter? Or what lightbox-tpyes are you using which are workable for this?

Thanks for any hints and ideas, gb5256

#7669 report it
sensorario at 2012/04/07 10:47am
New versione on github

https://github.com/sensorario/jitr

It need to be tested a bit. I've tried id and it work.

#7535 report it
Yureshwar Ravuri at 2012/03/28 08:11am
Hi sensorario

I think new version will be helpful.

Thanks

#7532 report it
claudio.ferrari at 2012/03/28 05:04am
New version

Yes,

I would like to try the new one

#7531 report it
Yureshwar Ravuri at 2012/03/28 04:51am
Could you please give the github issue list url

I am unable to find the url of the github for this project.

#7529 report it
sensorario at 2012/03/28 03:49am
Someone is interested in new version?

I've implemented a new version of jitr (JustInTimeResizer). This new version allow us to have 1 default size (original) and all others size we want. With a config file, we can create all fonder for all size:

verylittle little small original half

You think this will be helpful?

#7528 report it
sensorario at 2012/03/28 03:47am
Read the error message

If you read the error message you can see that ejustintimeresizer is redeclaring a class. Just remove this declaration. I please you to add this issue to github so I'll update this extension.

#7526 report it
Yureshwar Ravuri at 2012/03/28 03:02am
Getting error if i am trying to display multiple image files

Hi,

I am getting error if i am trying to call multiple images at a time

Fatal error: Cannot redeclare class Image_GD_Driver in /var/www/project/protected/extensions/image/drivers/GD.php on line 380

Can anyone help me out.

Solved it. It was image extension problem. Thanks sensorario.

#6577 report it
claudio.ferrari at 2012/01/19 09:20am
@Drini

Well done !

#6506 report it
Sampa at 2012/01/15 04:13pm
Brilliant! fantastic

This was a quality extension, thank you so very much!

I modified it slightly to use with EfancyBox gallery extension ( http://www.yiiframework.com/extension/fancybox/ ) New version of EJustIntimeR.php http://pastebin.com/rNfz3gn1 The view:

~~~ [php]

<?php $this->widget('application.extensions.fancybox.EFancyBox', array( 'target'=>'a[rel=gallery]', 'config'=>array(), ) ); ?>~~~

#6339 report it
claudio.ferrari at 2011/12/30 06:40pm
Great Job

This is what I was looking for !!! Thanks a lot.

Leave a comment

Please to leave your comment.

Create extension
Downloads