X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Resize thumbnails with GD (https://forum.x-cart.com/showthread.php?t=43719)

ADDISON 01-28-2009 10:59 PM

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.

pfarcus 01-31-2009 08:57 AM

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

pfarcus 02-01-2009 04:54 PM

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

ARW VISIONS 02-01-2009 05:33 PM

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.

pfarcus 02-01-2009 05:41 PM

Re: Resize thumbnails with GD
 
1 Attachment(s)
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

ARW VISIONS 02-01-2009 06:21 PM

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.

pfarcus 02-01-2009 06:25 PM

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

ARW VISIONS 02-01-2009 06:32 PM

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}

pfarcus 02-01-2009 07:18 PM

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!:D/

ARW VISIONS 02-01-2009 07:40 PM

Re: Resize thumbnails with GD
 
cool... glad I could help.


All times are GMT -8. The time now is 08:48 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.