- Description
- Install
- Usage
- Requirements
- Important!!
- Display thumbnail
- Display big image
- Set title or alt
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 =)'
)); ?>
Great Job
This is what I was looking for !!!
Thanks a lot.
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] <div class="gallery"> <?php $this->widget('ext.EJustInTimeR', array( 'image' => 'foo.jpg', 'rel' =>'gallery', )); ?> </div> <?php $this->widget('application.extensions.fancybox.EFancyBox', array( 'target'=>'a[rel=gallery]', 'config'=>array(), ) ); ?>~~~
@Drini
Well done !
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.
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.
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?
Could you please give the github issue list url
I am unable to find the url of the github for this project.
New version
Yes,
I would like to try the new one
Hi sensorario
I think new version will be helpful.
Thanks
New versione on github
https://github.com/sensorario/jitr
It need to be tested a bit. I've tried id and it work.
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
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.
this project is on github
For any issues or any pull request ...
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.
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?
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.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.