It’s been a while since I released my Rights module so I thought it was about time to give something new to the community. So, here it is, my newest module, Img.
Img is an image manager which allows for saving, loading, deleting and versioning of images in your Yii application. Images are stored both on the hard-drive and in the database. The module utilizes the PHPThumb library to provide a wide range of image transformation options.
Img comes with an installer so it’s very easy to set up and you should have it up and running in no time. Here’s a list of the features:
Features
Image management through one single application component.
Hello, i am new to yii and oo programming in php. i tried to use your module with code you provided in reply to "bonnie" in the module description.
i am getting error [color="#FF0000"]The table "{{Image}}" for active record class "Image" cannot be found in the database.[/color]
it is raised in saveImage() method.
the table in my database exists (i did run the install script of your module). i use mysql. can there be a problem with the capitalized first letter of table name? or any hints where is the problem?
i changed the tableName() method in your class Image to return ‘image’ instead of ‘{{Image}}’ and it works now. not sure if this is right i still do not understand the yii object concept entirely.
Hi, Chris this is Bonnie again. I tried using the module to upload and display the images as you said but I don’t see any file downloaded only my values for the auto listings. Also on the display the constant does not work. If you need I can post my code to see how am using it. I use CmultipleUpload widget for uploading. Thanks again. I really need help to get it working or if anybody has succeeded please help.
The problem is actually that the module doesn’t implement support for deleting images at all. However, I recently added this functionality and it will be included in the next release.
About this one I want to ask you about the next items:
[list=1][]As I understand you position this module as common way to manage all application images. If this is right, I want to ask about your willing to create some storing mechanism to distribute images files by different directories to avoid server loading when count is over ~1000 or more files in one directory.[]Maybe I did not figured how it works. What about caching created images? Will it always be recreated on each request?[*]Class ImgManager is declared as a child of CApplicationComponent, but in the ImgManager::init() method you don’t call parent::init(). Is this the same as should be?[/list]
I’ve started to use this and I noticed that some of the image conversions were a bit low quality - so I amended the phpThumb library to start using ImageMagick (instead of GD). Unfortunately this does not seem to work; i’m using auto-resizing of images (when called).