Zen Cart Logo
Forums / All Other Contributions/Addons / Fixed bug in IH2 - parameters passed via zen_image ignored

Fixed bug in IH2 - parameters passed via zen_image ignored

Locked

Views: 1,049

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
11 Dec 2009, 11:02 AM
#1
wgeoghegan avatar

wgeoghegan

New Zenner

Join Date:
Nov 2009
Posts:
3
Plugin Contributions:
0

Fixed bug in IH2 - parameters passed via zen_image ignored

Parameters passed to zen_image are ignored - here's the fix:

File: includes/functions/extra_functions/functions_bmz_image_handler.php

Around line 60:

Lines Added:

      $debugparameters = $parameters;
      $parameters .= $debugparameters;

New Code:

function handle_image($src, $alt, $width, $height, $parameters) {
        global $ihConf;

        if ($ihConf['resize']) {
        $ih_image = new ih_image($src, $width, $height);
    // override image path, get local image from cache
    if ($ih_image) {
      $src = $ih_image->get_local();
      $debugparameters = $parameters;
      $parameters = $ih_image->get_additional_parameters($alt, $ih_image->canvas['width'], $ih_image->canvas['height'], $parameters);
      $parameters .= $debugparameters;
    }
  } else {
23 Dec 2009, 9:47 PM
#2
hellmind avatar

hellmind

New Zenner

Join Date:
May 2009
Posts:
10
Plugin Contributions:
0

Re: Fixed bug in IH2 - parameters passed via zen_image ignored

Fixed, Thank you! :clap:

24 Dec 2009, 10:27 AM
#3
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

Re: Fixed bug in IH2 - parameters passed via zen_image ignored

Hi,
at the risk of looking dim,

what are the symptoms of this bug/what does the fix cure?

thanks
Steve

24 Dec 2009, 10:35 AM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Fixed bug in IH2 - parameters passed via zen_image ignored

torvista:

what are the symptoms of this bug/what does the fix cure?
A quick look suggests that this bug would have prevented the passing of additional parameters for use with an image. There would be no obvious symptom until you start to try to customise an image display by, for example, adding using those parameters to add additional ids, classes or (not recommended) inline styles to the html image tag, all of which would simply be ignored.

24 Dec 2009, 10:39 AM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Fixed bug in IH2 - parameters passed via zen_image ignored

wgeoghegan:

Parameters passed to zen_image are ignored ...

Your version must have been old... this "fix" is already evident in my copy of IH2.