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

Dynamic Images - a FREE mod for image resizing!

 
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4
 
Thread Tools
  #11  
Old 08-27-2008, 06:29 AM
 
Stizerg Stizerg is offline
 

Senior Member
  
Join Date: Apr 2008
Location: Sydney, Australia
Posts: 195
 

Default Re: Dynamic Images - a FREE mod for image resizing!

Thanks Jon!
I was looking for solution like this, to replace my pics resizer.
Now, page loads much faster. (I use it for detailed images only).
__________________
X-Cart Gold Plus 4.6.6
A lot of custom mods
Reply With Quote
  #12  
Old 08-28-2008, 05:24 AM
 
gennarof gennarof is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 46
 

Default Re: Dynamic Images - a FREE mod for image resizing!

Thanks Jon..I manually deleted the files I ftp's into the root, deleted the /cache/ directory I created in under the images directory and reinstalled from / at the folder level after correcting the zip file that previously only showed the files not the directory structure. In short I ftp'd the 3 folders beneath the upload folder ( /images, /include , /sq) into the root directory of the site. I manually patched the skin1/product_thumbnail.tpl. and the images seem to showing up ok now. Thanks much..

I do have one other concern..In the backend .. when I go to modules to activate the mod.. It shows the Dynamic Images module twice. When I tick one of the boxes to activate the module and then "update" both itterations of the module show as ticked. I am sure this is because I messed up the first install. and ran the patch twice. Do you have any Idea how I can get rid of the duplicate listing of the module. (see screen print attached)

http://desertvalleyelectronics.com/Public/dynamicimage.jpg
__________________
Ver 4.1.9

Last edited by gennarof : 09-12-2008 at 04:45 AM. Reason: My apache server err log is getting continious itterations of client denied by server configuration:referer: http://forum.x-cart.com/showthread.php?t=41911&page=2
Reply With Quote
  #13  
Old 08-28-2008, 07:17 PM
 
mpgyvr mpgyvr is offline
 

Member
  
Join Date: Oct 2007
Location: Vancouver, BC
Posts: 10
 

Default Re: Dynamic Images - a FREE mod for image resizing!

Works great for my product images. But I'd like to have my thumbnails also resized, but off the product images, so there needs to be only 1 imaged stored on the system. I've tried to modify products.tpl, but I can't make it work. Has anybody got a solution like this working?

thanks kindly!


Quote:
Originally Posted by Stizerg
Thanks Jon!
I was looking for solution like this, to replace my pics resizer.
Now, page loads much faster. (I use it for detailed images only).
__________________
Malcolm

Xcart v4.1.10
www.sycorp.ca
Reply With Quote
  #14  
Old 08-28-2008, 07:44 PM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default Re: Dynamic Images - a FREE mod for image resizing!

gennarof: this will remove the duplicate, execute in SQL Patch area of X-Cart.
Code:
DELETE FROM xcart_modules WHERE module_name LIKE "PHPSS_Dynamic_Images" LIMIT 1;

mpgyvr: I just upload 1 large image to my product's thumbnail, that same image is used for product listings or the actual product page itself. That way, there's only one original image, and it is resized as needed for each area that the image is displayed (whether product page or product listings). Also, if you haven't already, I suggest you implement the how-to for enhancing Dynamic Images further, as it gives you a nice pop-up effect to view your full-size image. (the link should be on the first page of this thread, or you can just visit my forums directly to find the thread)
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #15  
Old 08-29-2008, 04:43 PM
 
Darryl Darryl is offline
 

Advanced Member
  
Join Date: Feb 2008
Location: BC, Canada
Posts: 52
 

Default Re: Dynamic Images - a FREE mod for image resizing!

Hi,

A couple of questions.

Where do I find the watermarking feature (I did try).

Would it be possible to add "Click to enlarge" or something to that effect below the product image so people are aware they can access the detailed image.

Thanks
__________________
Version 4.1.11
Reply With Quote
  #16  
Old 08-29-2008, 07:55 PM
 
pcparts pcparts is offline
 

Advanced Member
  
Join Date: Jul 2006
Location: Aussie
Posts: 85
 

Default Re: Dynamic Images - a FREE mod for image resizing!

It is possible to add a water mark feature to this mod.

If i get time over the weekend i will have ago.

You could try and add in skin1/customer/main/product.tpl

Under
Code:
{if $active_modules.Magnifier ne "" && $config.Magnifier.magnifier_image_popup eq 'Y' && $zoomer_images ne '' && $js_enabled eq 'Y'} {include file="modules/Magnifier/popup_magnifier.tpl"} {/if}

Add
Code:
<br /><br /> Click image to enlarge <br /><br />
__________________
Greg
X-CART Gold 4.1.10
Reply With Quote
  #17  
Old 08-29-2008, 08:30 PM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default Re: Dynamic Images - a FREE mod for image resizing!

Quote:
Originally Posted by Darryl
Hi,

A couple of questions.

Where do I find the watermarking feature (I did try).

Would it be possible to add "Click to enlarge" or something to that effect below the product image so people are aware they can access the detailed image.

Thanks

Hi Darryl, here you go

Code:
{thumb file="images/D/variant_chart_Example-1_live.jpg" width=500 hint=false overlay="images/famguystewie.png" overlay_position=5 legend="Click to Enlarge"}

The image generated from this code is attached.
The "Click to Enlarge" bit is better done as suggested by PCParts, as you can style it his way. This example is just to show what is possible regarding what you requested.

Just a note, overlay_position=5 sets the overlay image to the center. Your options are 1-9 (starting from top left).

Additionally, to give people a "hint" that they can click to expand the image, you can set hint=true (or remove the reference completely, as I believe default is true), which will add a magnifier glass to the lower right of your image.

You can view the comments at the top of the file in include/templater/function.thumb_imp.php, to find out more about what's possible.

EDIT: Using my method (the default thumb_imp method), you can only submit a .png file as an overlay image
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #18  
Old 08-29-2008, 10:22 PM
 
pcparts pcparts is offline
 

Advanced Member
  
Join Date: Jul 2006
Location: Aussie
Posts: 85
 

Default Re: Dynamic Images - a FREE mod for image resizing!

Try this for watermark images on all products it worked ok on my local computer.

In function.thumb_imp

Change line 527 to this

Code:
$overlay = imagecreatefromgif($params['overlay']);

Under
Code:
/* load the "overlay"-image */

Create a folder watermark in your root images directory.

In skin1/product_thumbnail.tpl

Change this
Code:
{thumb file="$tfile" width="$image_x" link="false" hint="false" overlay_position="$overlay_position" overlay="$overlay" sharpen="$sharpen" get_image_path="$get_image_path" html="class=\"$class\" alt=\"`$alt`\""}

To this

Code:
{thumb file="$tfile" width="$image_x" link="false" hint="false" overlay_position="$overlay_position" overlay_position="5" overlay="images/watermark/site.gif" sharpen="$sharpen" get_image_path="$get_image_path" html="class=\"$class\" alt=\"`$alt`\""}

Create a watermark image and put it in images/watermark

To change the image name just change this (site.gif) in the product_thumbnail.tpl

There might be better ways of doing this some others might like to add to it.
__________________
Greg
X-CART Gold 4.1.10
Reply With Quote
  #19  
Old 09-02-2008, 07:24 AM
  polkadotninja's Avatar 
polkadotninja polkadotninja is offline
 

Newbie
  
Join Date: Aug 2007
Posts: 5
 

Default Re: Dynamic Images - a FREE mod for image resizing!

Just wanted to chime in and note that this is a great mod. I purchased the Telefirma mod, but it took a long while to get and is tied to a single domain. Not sure if it'll work on test localhost domains, but haven't gotten answer to this or any other basic Q's from the provider, so I'm too nervous about requiring any possible support down the road to use it. Found this mod while waiting for delivery of the Telefirma mod, though, and I love it.

I installed the Lytebox changes as suggested, and like that a lot, too. I made a few minor changes that I'd like to share in case anybody is interested. I wanted to have the image on the product editing page be resized, too, so ended changing the following files ...

skin1/main/edit_image.tpl, changed image line to the following:
PHP Code:
{if $active_modules.PHPSS_Dynamic_Images ne ""}
  <
a href="{$product.tmbn_url}title="{$product.product|escape}rel="lytebox[detailed]"><img src="/{thumb file=$product.tmbn_url width=$phpss_dyn_img_width|default:$product.image_x link=false hint=false get_image_path=true}" id="product_thumbnail" class="thumb" alt="{include file="main/image_property.tpl"}" /></a>
{else}
  <
img id="{$idtag}src="{$xcart_web_dir}/image.php?type={$type}&amp;id={$id}&amp;ts={$smarty.now}{if $already_loaded}&amp;tmp=Y{/if}"{if $image_x ne 0width="{$image_x}"{/if}{if $image_y ne 0height="{$image_y}"{/if} alt="{include file="main/image_property.tpl"}"/>
{/if} 

skin1/admin/home.tpl and skin1/provider/home.tpl, added the following to the head tag:
HTML Code:
{* Lytebox *} <script type="text/javascript" language="javascript" src="{$SkinDir}/js/lytebox.js"></script> <link rel="stylesheet" href="{$SkinDir}/css/lytebox.css" type="text/css" media="screen" /> {* /Lytebox *}

Now going to try to eliminate the product listing thumbnails and just replace them with a resized version of the main image ... if anybody has advice on this, please share
__________________
Version 4.1.10
Reply With Quote
  #20  
Old 09-02-2008, 08:55 AM
  polkadotninja's Avatar 
polkadotninja polkadotninja is offline
 

Newbie
  
Join Date: Aug 2007
Posts: 5
 

Default Re: Dynamic Images - a FREE mod for image resizing!

One more note ... in case anyone is interested in doing what I mentioned at the end of the last post (replacing product thumbnails with a resized version of the main product image), here's what I came up with, which, so far, seems to work ...

In include/func/func.files.php:

Modify the function call for func_get_image_url to look like the following (added one arg) -

PHP Code:
function func_get_image_url($id$type 'T'$image_path false$no_url false) { 

Then modify the line in that same function which looks like this -

PHP Code:
if (is_url($image_path)) { 

to this -

PHP Code:
if (is_url($image_path) || $no_url) { 

In include/search.php:

Modify the section that looks like this -

PHP Code:
# Get thumbnail URL
       
$products[$k]["tmbn_url"] = false;
                
        if (!
is_null($v['image_path_T'])) { 

to this -

PHP Code:
# Get thumbnail URL
       
$products[$k]["tmbn_url"] = false;
        
        if (
$active_modules.PHPSS_Dynamic_Images != "") {
          
$products[$k]["tmbn_url"] = func_get_image_url($v['productid'], "P"falsetrue);
        }
        
        else if (!
is_null($v['image_path_T'])) { 


Oh, one last thing, you might as well hide the thumbnail rows in skin1/main/product_details.tpl. I think that's it. Everything else just works once that's done ... the trick was to make the tmbn_url property point to the product's main image URL.

- Sam
__________________
Version 4.1.10
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4


Thread Tools

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 01:04 AM.

   

 
X-Cart forums © 2001-2020