Yii Framework Forum: Saimagedisplayer : Image Does Not Show - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Saimagedisplayer : Image Does Not Show Rate Topic: -----

#1 User is offline   rhigel 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 18-April 13

Posted 08 May 2013 - 12:06 PM

i use image-displayer extension. the image only show the title as picture. can anyone give me advice where i do wrong in my code :huh:

_view.php


    	<?php $this->widget('saimagedisplayer', array(
        	'image' => '21.png',
        	'size' => 'tiny',
        	'displayImage' => true,
        	'title' => 'My super title',
    	)); ?>   


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

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'),
            	),           	
	),

0

#2 User is offline   darkheir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 66
  • Joined: 25-July 11

Posted 08 May 2013 - 01:58 PM

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!
My blog (in french) => http://blog.devsa.org
0

#3 User is offline   rhigel 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 18-April 13

Posted 08 May 2013 - 10:05 PM

i edited to ""SAImageDisplayer" in _view.php and main.php. but the problem persist.

FYI, i copy SAImageDisplayer folder into yii extension folder. so not one file (SAImageDisplayer.php) like in tutorial. i think its fine because i already use import in main.php : 'ext.SAImageDisplayer.*'

i have some questions:


1. if i click right mouse button on image (that appear as wrongly as title), and then i choose "ViewPicture" then it will give this error message :

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


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. the Request_URI react to controller, so its pointing to the right location. but the 'images' is in webroot.

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 'SAImageDisplayer' recognize where the file is. only it does not show correctly.

3.

                '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'),
                ), 



CMIIW. if i use 'driver'=>'GD' then i dont need 'params'=>array('directory ...'? am i right?

if you have any idea or hint, please let me know. thank you for your response Posted Image
0

#4 User is offline   darkheir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 66
  • Joined: 25-July 11

Posted 09 May 2013 - 05:12 AM

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.
My blog (in french) => http://blog.devsa.org
1

#5 User is offline   rhigel 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 18-April 13

Posted 09 May 2013 - 06:38 AM

View Postdarkheir, on 09 May 2013 - 05:12 AM, said:

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

yup, i use yii
webroot images folder. i mean the folder images that comes when extracting yii.

View Postdarkheir, on 09 May 2013 - 05:12 AM, said:

* Are you using a theme in your project ?


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. Posted Image

View Postdarkheir, on 09 May 2013 - 05:12 AM, said:

* 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)


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 !!! Posted Image
0

#6 User is offline   darkheir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 66
  • Joined: 25-July 11

Posted 10 May 2013 - 04:41 AM

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!
My blog (in french) => http://blog.devsa.org
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users