Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Resize thumbnails with GD

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 01-28-2009, 10:59 PM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Re: Resize thumbnails with GD

Did you take a look at phpThumb() http://phpthumb.sourceforge.net/ ?

In my opinion is far better than Smart Image Resizer. With a lot of options in the URL like Unsharp Mask, Clip, Quality, etc.

Did anyone use it with X-Cart?

Could you please give me more idea about Thumb Generators in PHP (Image Resizers)? I am trying to find one better the phpThumb.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #22  
Old 01-31-2009, 08:57 AM
 
pfarcus pfarcus is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 179
 

Default Re: Resize thumbnails with GD

Thx for that, I will have to look into how/if you use it with xcart, since I'm not too slick in that area I don't expect much. But let me know if you figure it out, I'd be very interested to hear what you came up with.

Thx
__________________
CDSEO PRO
4.1.11 PRO
Dynamic images by xcartmod.com
X-Cart CSSTemplate/Skin for v4.1.11 PRO
Reply With Quote
  #23  
Old 02-01-2009, 04:54 PM
 
pfarcus pfarcus is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 179
 

Default Re: Resize thumbnails with GD

It looks like its squishing it into a square thumb, anyone know how to have it size and crop to a square? I was looking at the file imager.php and it mentions some stuff about cropping, but I don't know how to implement it.

It has this:

// Resizing and cropping a JPEG into a square:
// <img src="/image.php/image-name.jpg?width=100&amp;height=100&amp;cropratio=1: 1&amp;image=/path/to/image.jpg" alt="Don't forget your alt text" />


Help?
thx
__________________
CDSEO PRO
4.1.11 PRO
Dynamic images by xcartmod.com
X-Cart CSSTemplate/Skin for v4.1.11 PRO
Reply With Quote
  #24  
Old 02-01-2009, 05:33 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Resize thumbnails with GD

width=100&amp;height=100&amp;cropratio=1: 1

try to play witht he crop ration along with the width and height.

maybe width=100&amp;height=150&amp;cropratio=1: 1.5

just a guess tho.
__________________
xcart 5.1.2
Reply With Quote
  #25  
Old 02-01-2009, 05:41 PM
 
pfarcus pfarcus is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 179
 

Default Re: Resize thumbnails with GD

Thanks Ashley,

The problem is I can't find that code in the php or the thumbnails.tpl, (its above the "code starts here" part) the guy from post #1 figured out how to integrate this php script into xcart. Waaaay beyond me right now. His code is in post #1, the php is attached if you want to look at it.

Thanks
Attached Files
File Type: php imager.php (13.0 KB, 109 views)
__________________
CDSEO PRO
4.1.11 PRO
Dynamic images by xcartmod.com
X-Cart CSSTemplate/Skin for v4.1.11 PRO
Reply With Quote
  #26  
Old 02-01-2009, 06:21 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Resize thumbnails with GD

Ok this code

// Resizing and cropping a JPEG into a square:
// <img src="/image.php/image-name.jpg?width=100&amp;height=100&amp;cropratio=1: 1&amp;image=/path/to/image.jpg" alt="Don't forget your alt text" />


Is a comment and has nothing to do with the actual implementation of the mod.

Just follow the instructions in the first post and you should be ok.
__________________
xcart 5.1.2
Reply With Quote
  #27  
Old 02-01-2009, 06:25 PM
 
pfarcus pfarcus is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 179
 

Default Re: Resize thumbnails with GD

I know, I already have the mod working, but it sizes/squishes instead of sizing/cropping to a square image, I was just wondering if someone out there might want to implement the cropping aspect of this php script. I am too green at this point.

thx
__________________
CDSEO PRO
4.1.11 PRO
Dynamic images by xcartmod.com
X-Cart CSSTemplate/Skin for v4.1.11 PRO
Reply With Quote
  #28  
Old 02-01-2009, 06:32 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Resize thumbnails with GD

try this instread in product_thumbnail

{* $Id: product_thumbnail.tpl,v 1.19.2.1 2007/07/09 05:00:35 svowl Exp $ *}
{if $config.Appearance.show_thumbnails eq "Y" or ($type ne "T" and $type ne "")}<img{if $id ne ''} id="{$id}"{/if} src="{if $tmbn_url}./imager.php/product_thumb.jpg?width={$image_x}&amp;cropratio=1 :1&amp;image={$tmbn_url}{else}{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?type={$type|default:"T"}&amp;id={$produc tid}{/if}"{if $image_x ne 0} width="{$image_x}"{/if}{if $image_y ne 0} height="{$image_y}"{/if} style="margin:5px;" alt="{$product|escape}" />{/if}
__________________
xcart 5.1.2
Reply With Quote
  #29  
Old 02-01-2009, 07:18 PM
 
pfarcus pfarcus is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 179
 

Thumbs up Re: Resize thumbnails with GD

This works! No more squished thumbnails! (for those of us who don't want to photoshop every dang ol' product.)

Alright Ashley!
__________________
CDSEO PRO
4.1.11 PRO
Dynamic images by xcartmod.com
X-Cart CSSTemplate/Skin for v4.1.11 PRO
Reply With Quote
  #30  
Old 02-01-2009, 07:40 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Resize thumbnails with GD

cool... glad I could help.
__________________
xcart 5.1.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:13 AM.

   

 
X-Cart forums © 2001-2020