• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [SOLVED] CGSmartImage max width and height
PostPosted: Mon Jan 16, 2012 6:49 pm 
Offline
Forum Members
Forum Members

Joined: Thu Dec 27, 2007 5:27 pm
Posts: 108
Hello,

I saw caution "Image processing functions are deprecated..." in Products module and started to use CGSmartImage module.

Great image processing module.
But I have problems with setting maximum width or height of re-sized photo...

Code:
{capture assign=artwork}{$entry->file_location}/{$entry->fields.artwork->value}{/capture}
{CGSmartImage src=$artwork filter_resizetofit="100,100"}
{CGSmartImage src=$artwork filter_resize="w,100" filter_resize="h,100"}
{CGSmartImage src=$artwork width="100" height="100"}
{cgsi_convert max_width="100" max_height="100"}{CGSmartImage src=$artwork}{/cgsi_convert}


None of above is not working as I need. Last approach do not show image at all.

McF


Last edited by McF on Wed Jan 18, 2012 6:10 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: CGSmartImage max width and height
PostPosted: Wed Jan 18, 2012 6:09 pm 
Offline
Forum Members
Forum Members

Joined: Thu Dec 27, 2007 5:27 pm
Posts: 108
Solved.

Using PHP function getimagesize I get width and height. Then I compare width with height and use CGSmartImage depending on which measurement is greater.

Code:
{capture assign=image}{$entry->file_location}/{$entry->fields.image->value}{/capture}
{assign var="image_atr" value=$image|getimagesize}
{if $image_atr[0] gt $image_atr[1]}
  {CGSmartImage src=$image filter_resize="w,100"}
{else}
  {CGSmartImage src=$image filter_resize="h,100"}
{/if}


Top
 Profile  
 
 Post subject: Re: CGSmartImage max width and height
PostPosted: Tue Jan 31, 2012 1:19 pm 
Offline
Forum Members
Forum Members

Joined: Tue Jun 06, 2006 1:10 pm
Posts: 110
Location: TX
Thanks I need this. I tried the tag {cgsi_convert} and could never get it to work.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting