iheartwine Posted May 12, 2010 Share Posted May 12, 2010 I want to change a little bit auto-thumbnail generator - instead of adding white margin, i want to crop them.when we have e.g. 600x400px picture, first it changes into a square 600x600 and than resizes. I want to make it center crop to 400x400 (cut 100px from both sides) and than resize. This should work for every thumbnails except thickbox. Any ideas? Link to comment Share on other sites More sharing options...
iheartwine Posted May 28, 2010 Author Share Posted May 28, 2010 anyone could help me? Link to comment Share on other sites More sharing options...
rocky Posted May 29, 2010 Share Posted May 29, 2010 This is actually quite difficult to do and makes it hard to specify the width and height of the image in the HTML code. I suggest that you make all the images the same aspect ratio and change the image sizes so they aren't square, like I did on the munum website. Link to comment Share on other sites More sharing options...
iheartwine Posted May 29, 2010 Author Share Posted May 29, 2010 but i want to make squared thumbnails. Here http://www.paleofossil.com/ i made them with photoshop, but it's not comfy for my client.Maybe it's possible with hand-generated thumbnails? but only if crop area in back-office could be scalable..So how can i make squarred thumbnails without graphic software ingerention like photoshop etc? Link to comment Share on other sites More sharing options...
rocky Posted May 29, 2010 Share Posted May 29, 2010 Nice design!I think I understand now. So you want to crop the image so that it fills the whole square?You'll need to mess around with the code in images.inc.php. I think you might be able to get it to resize by height instead of width or vice versa, which may give you what you want. I can't think of the code to do it off-hand though. I can only find these posts here and here. Link to comment Share on other sites More sharing options...
iheartwine Posted May 29, 2010 Author Share Posted May 29, 2010 thanks this shop i based on Wallcraft skin http://photosalgerie.free.fr/wallcraft/but totally modified and not finished yet.i thought just like you said, about switching width&height;, but i want to do this for every thumbs except thickbox - it should present whole picture in fact.If anyone have any idea, i would be nice i`ll try to change images.inc.php a little bit. Link to comment Share on other sites More sharing options...
iheartwine Posted May 30, 2010 Author Share Posted May 30, 2010 okay, i give up.. does anyone have got any idea how to make every thumbnails except thickbox do AUTO-CENTER-SQUARE-CROP? :/ Link to comment Share on other sites More sharing options...
netcrawle Posted May 31, 2010 Share Posted May 31, 2010 Personally I tossed Prestashop's notoriously bad imagehandling to sea and currently use http://code.google.com/p/smart-lencioni-image-resizer/ for image-scaling, works like a dream. Lets me call up images like this for instance: Where i can controll, quality, crop-ratio etc from a template-level. Very handy Link to comment Share on other sites More sharing options...
iheartwine Posted May 31, 2010 Author Share Posted May 31, 2010 at first sight it seems to be a quite good solution i`ll try to implement it to my shop. thanks! Link to comment Share on other sites More sharing options...
iheartwine Posted May 31, 2010 Author Share Posted May 31, 2010 i have a problem with slir - it returns "image path may not contain..."i putted it returns an error :/SOLVEDinstead of I did Here is SLIR in action:http://paleofossil.com/10-ordowikWORKS GREAT!!!! Link to comment Share on other sites More sharing options...
iheartwine Posted May 31, 2010 Author Share Posted May 31, 2010 but how should we cope with a thickbox enlargement?i did getImageLink($cover.id_image)}" {if $jqZoomEnabled}class="jqzoom" alt="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox')}"{else} title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" {/if} id="bigpic"/> but there is still a zooming problem :/SOLVED AGAINgo to themes/xxx/js/product.jsfind function displayImage(domAAroundImgThumb) { if (domAAroundImgThumb.attr('href')) { var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large'); and change into e.g. function displayImage(domAAroundImgThumb) { if (domAAroundImgThumb.attr('href')) { var newSrc = domAAroundImgThumb.attr('href').replace('w600','w300-h300-c1:1'); in product.tpl thumbnails should look like: good luck ! there is an error in form, it eats my code part. below you've got missing part (delete spacebars) < a h r e f =" { $base_dir } mini/w600/img/p{$link->getImageLink($imageIds)}" rel="other-views" class="{if !$jqZoomEnabled}thickbox{/if} {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}"> e] getImageLink($imageIds)}" rel="other-views" class="{if !$jqZoomEnabled}thickbox{/if} {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}"> getImageLink($imageIds)}" alt="{$image.legend|htmlspecialchars}"/> Link to comment Share on other sites More sharing options...
Adober Posted November 18, 2010 Share Posted November 18, 2010 2iheartwine, thanks a lot you really help me Link to comment Share on other sites More sharing options...
Recommended Posts