Saimagedisplayer : Image Does Not Show

[size=“2”]i use [/size][size=“3”][size=“2”]image-displayer[/size][/size][size=“2”] extension. the image only show the title as picture. can anyone give me advice where i do wrong in my code [/size] [size=“2”]:huh:

_view.php[/size]


    	<?php $this->widget('saimagedisplayer', array(

        	'image' => '21.png',

        	'size' => 'tiny',

        	'displayImage' => true,

        	'title' => 'My super title',

    	)); ?>   

[size="2"]it show the name/title "21.png" as picture. it doesnot show the real picture. [/size][size="2"]i wonder why is that happen. below is my main code.[/size]

main.php




	'import'=>array(

           	....

            	'application.helpers.*', // yii image

            	'ext.saimagedisplayer.*',// SAImageDisplayer

    	

	),

	'components'=>array(


            	...

        	

            	'widgetFactory'=>array(

                	'widgets'=>array(

                    	'saimagedisplayer'=>array(

                        	'baseDir' => 'images',

                        	'originalFolderName'=> 'originals',

                        	'sizes' =>array(

                            	'tiny' => array('width' => 40, 'height' => 30),

                            	'big' => array('width' => 640, 'height' => 480),

                            	'thumb' => array('width' => 400, 'height' => 300),

                        	),

                    	),

                	),

            	),

        	

            	'image'=>array(

              	'class'=>'application.extensions.image.CImageComponent',

                	// GD or ImageMagick

                	'driver'=>'GD',

                	// ImageMagick setup path

                	//'params'=>array('directory'=>'/opt/local/bin'),

                	'params'=>array('directory'=>'C:/Program Files (x86)/ImageMagick-6.8.5-Q16'),

            	),           	

	),

And you should try to use the name "SAImageDisplayer" with the uppercase in the config and when you are calling the widget because I think that classes are case sensitive. Tell me if it solves your problem!

i edited to "[color="#1C2837"][size="2"]"SAImageDisplayer" in _view.php and main.php. [/size][/color][color="#1C2837"][size="2"]but the problem persist. [/size][/color]

[color="#1C2837"][size=“2”]FYI, i copy [/size][/color][color="#1C2837"][size=“2”]SAImageDisplayer [/size][/color][color="#1C2837"][size=“2”]folder into yii extension folder. so not one file ([/size][/color][color="#1C2837"][size=“2”]SAImageDisplayer.php[/size][/color][color="#1C2837"][size=“2”]) like in tutorial. i think its fine because i already use import in main.php : 'ext.[/size][/color][color="#1C2837"][size=“2”]SAImageDisplayer.*’[/size][/color]

[color="#1C2837"][size="2"]i have some questions:[/size][/color]

[size="2"][color="#1c2837"]1. if i [/color][/size]click r[size="2"][color="#1c2837"]ight mouse button on image (that appear as wrongly as title), [/color][/size][color="#1C2837"][size="2"]and then i choose "ViewPicture"[/size][/color] [color="#1C2837"][size="2"] then it will give this error message :[/size][/color]




exception 'CHttpException' with message 'The system is unable to find the requested action "images"

...

...

REQUEST_URI=/application/softwarekanjeng/index.php/skn/GalleryPhoto/images/thumb/21.pngHTTP_REFERER=http://localhost/application/softwarekanjeng/index.php/skn/GalleryPhoto/index

[color="#1C2837"][size=“2”]im not very sure, but i just wonder is that has anything to do with the rendering wrongly? like i said, its only appear the title as picture, not the real picture. [/size][/color][color="#1C2837"][size=“2”]the Request_URI react to controller, so its pointing to the right location. but the ‘images’ is in webroot.[/size][/color]

[color="#1C2837"][size=“2”]2. [/size][/color][color="#1C2837"][size=“2”]FYI, the picture is exist in the folder /images/originals. if i change “21.php” in _view.php to something else, it will geve an error a file do not exist. so im sure ‘[/size][/color][color="#1C2837"][size=“2”]SAImageDisplayer’ recognize where the file is. only it does not show correctly.[/size][/color]

[color="#1C2837"][size="2"]3. [/size][/color]

[color="#1C2837"][size="2"]




                'image'=>array(

                  'class'=>'application.extensions.image.CImageComponent',

                    // GD or ImageMagick

                    'driver'=>'GD',

                    // ImageMagick setup path

                    //'params'=>array('directory'=>'/opt/local/bin'),

                    'params'=>array('directory'=>'C:/Program Files (x86)/ImageMagick-6.8.5-Q16'),

                ), 

[/size][/color]

[color="#1C2837"][size=“2”]CMIIW. if i use [/size][/color][color="#1C2837"][size=“2”]‘driver’=>‘GD’ then i dont need [/size][/color] [color="#1C2837"][size=“2”]‘params’=>array(‘directory …’? am i right?[/size][/color]

[color="#1C2837"][size="2"]if you have any idea or hint, please let me know. thank you for your response [/size][/color]

Hum I have a few question:

  • Does your image folder is in the webroot folder (web by default) ?

  • Are you using a theme in your project ?

  • In your image folder is the right size image created? (in your fist post you put the size ‘tiny’ so is there an image created in this folder)

Then you should try the new version I just released (v1.3) that add the base url to the image path when displaying it.

[size="2"]

yup, i use yii [/size][size="2"]webroot[/size][size="2"] images folder. i mean the folder images that comes when extracting yii.[/size]

i use bootsrap theme. and i already move all view to theme view. i dont know its the right thing to do or not, i just feel if i have view folder here and there, it just confuse me. thats why i move all of view inside theme.

the images in tiny, thumb, and big folder are automatically created by SAImageDisplayer base on file inside originals folder. so yes, there are image files already inside those folder. and in every folder the images has different size.

thank you for the new version. it works !!!

Glad it works!

I updated the etension a few days ago because i was meeting some erors when I was using a theme, but I totally forgot to update it on the website!