Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
I had set a certain size on images uploaded to be sized to I thought but when my client uploads an image it doesnt seem to follow what has been set......On news.php I have the width set at 600 and height=450 and I have it set up that news_list.html and index.php are linked to it with the masterpage tag....Am I doing something wrong? I thought that the image would automatically take the size I set it at

This is code at top of news.php template:
Code: Select all
<cms:template title='News' clonable='1' commentable='1' order='-12'>
    <cms:editable name='News_content' type='richtext' />
    <cms:editable name='News_image'
       width='600'
       height='450'
       quality='100'
       type='image'
     />
<cms:editable name='videolink' label='YouTube Video ID' type='textarea' width="400" height="335" no_xss_check='1' />
<cms:editable name='sidebarAd7_image' width='370' height='250' quality='100' type='image' />
<cms:repeatable name='sidebar_Adslider3' >
<cms:editable name='sidebarAdSlider3_image' label='Image' width='150' height='160' quality='100' type='image'/> </cms:repeatable>
  <cms:folder name="localnews" title="Local News" />
<cms:folder name="marioncounty" title="Marion County" />
<cms:folder name="southpittsburg" title="South Pittsburg" />
<cms:folder name="whitwell" title="Whitwell" />
<cms:folder name="chattanooga" title="Chattanooga" />
</cms:template>
<cms:if k_is_page >
<!doctype html>
<html lang="en">
<head>


This is index.php
Code: Select all
   <!-- Carousel items -->
               <div class="carousel-inner">
                          <cms:pages masterpage='news.php' limit='6' startcount='0'>
                              <div class="item <cms:if k_count='0'>active</cms:if>">
                   <div class="container slide-element">
                                 

<img src="<cms:show News_image />" alt=""/>
      <p><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></p>
                     
                    </div> <!-- /.slide-element -->
                                     </div> <!--/.active /.item -->
                                         </cms:pages>
                  
               </div> <!-- /.carousel-inner -->
               
               <!-- slider nav -->
               <a class="carousel-control left" href="#ccr-slide-main" data-slide="prev"><i class="fa fa-arrow-left"></i></a>
               <a class="carousel-control right" href="#ccr-slide-main" data-slide="next"><i class="fa fa-arrow-right"></i></a>

               <ol class="carousel-indicators">
         <cms:pages masterpage='news.php' limit='6' startcount='0'>   
  <li data-target="#ccr-slide-main" data-slide-to="<cms:show k_count />"<cms:if k_count='0'>class="active"</cms:if>></li>
</cms:pages>        
               </ol> <!-- /.carousel-indicators -->

                     
         </section><!-- /#ccr-slide-main -->



And newslist_list.html
Code: Select all
<cms:pages masterpage='news.php' folder=k folder name
                       start_on=k_archive_date stop_before=k_next_archive_date
paginate='1' limit='3' >
                                                  <article>
                     <figure class="blog-thumbnails">
         <img class="thumb" src="<cms:show News_image />" alt=""/>
                     </figure> <!-- /.blog-thumbnails -->
                     
<div class="blog-text">
               <h4><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h4>
                        <p>
<cms:excerptHTML count='75' ignore='img'><cms:show News_content /></cms:excerptHTML>
                        </p>
                        
                        <div class="meta-data">         
                           <a href="#" class="like"><i class="fa fa-thumbs-o-up"></i><cms:show k_comments_count /></a>
                           <a href="#" class="comments"><i class="fa fa-comments-o"></i><cms:show k_comments_count /></a>         
                           <span class="read-more"><a href="<cms:show k_page_link />">Read More</a></span>
                        </div>
                  </div> <!-- /.blog-text -->
               <cms:if k_paginated_bottom >   
<div class="clearfix"></div>
            <nav class="nav-paging pull-center">
               <ul>
   <cms:if k_paginate_link_next >               
    <li><a href="<cms:show k_paginate_link_next />"><i class="fa fa-chevron-left"></i></a></li>
                  </cms:if>
                                                <li><a href="#">1</a></li>
                  <li><a href="#">2</a></li>
                  <li><span class="#">3</span></li>
                  <li><a href="#">4</a></li>
                  <li><a href="#">5</a></li>
      <cms:if k_paginate_link_prev>                                                       <li><a href="<cms:show k_paginate_link_prev />"><i class="fa fa-chevron-right"></i></a></li></cms:if >
               </ul>
            </nav>
                             </cms:if>
</article></cms:pages >
Hi,
On news.php I have the width set at 600 and height=450 ..but when my client uploads an image it doesnt seem to follow what has been set..

The way it works is if you try to upload an image that exceeds (in any of the two dimensions) the values you have set, Couch will resize it till the new dimensions are *within* 600 x 450.

That is because by default the 'enforce_max' parameter is used by 'image' editable region.
You can see it demonstrated in the docs - http://www.couchcms.com/docs/tags-refer ... image.html

If you need an image that is always exactly 600x450, you'll have to set crop='1'. Again, the docs page mentioned above will show you the results.

Hope it helps.
Hello everyone,

I am using the following code

Code: Select all
      <cms:repeatable name='praxis_pictures' label='Galerie-Bilder'>
         <cms:editable name='praxis_image' type='image' width='1600' height='900' enforce_max='1' />
      </cms:repeatable>


but when I upload an image it does not get resized to the maximum width and height. It just gets uploaded without any changes; the dimensions remain 5312x2988 px.

What did I do wrong?
@madtrigger

Hi,

Two possible causes come to my mind -
1. You have not visited the template as super-admin after adding the dimensions (required for the changes to be picked up by Couch). Please do this and see if this works.

2. It is also possible that the script doing the actual cropping (TimThumb) is encountering some trouble in the process - it could be insufficient memory or a permission issue (e.g. no Write permission for it in the images folder). I suggest you take a look at the server error log to see if anything related is being reported.

Hope this helps.
KK wrote: it could be insufficient memory


@KK
Thank you for your reply. I guess it's the memory. I checked all the other things and it still didn't work. I will have a look at the log file. Thanks again!
5 posts Page 1 of 1