Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2009
    Location
    Nelson, NZ
    Posts
    26
    Plugin Contributions
    0

    Default Suggestion to fix an image problem

    I find the system overriding the image size settings supplied to the function when there is a leading '/' or when only the width or only the height is specified.

    To avoid that, in the html_output.php file can I suggest a small modification to the zen_image function at or around line 245

    [FONT="Courier New"] // only use proportional image when image is larger than proportional size
    if ($image_size[0] < $width and $image_size[1] < $height) {
    $image .= ' width="' . $image_size[0] . '" height="' . intval($image_size[1]) . '"';
    } else {
    $image .= ' width="' . round($width) . '" height="' . round($height) . '"';
    }
    } else {
    // override on missing image to allow for proportional and required/not required
    if (IMAGE_REQUIRED == 'false') {
    return false;
    } else {
    $image .= ' width="' . intval(zen_not_null($width) ? $width : SMALL_IMAGE_WIDTH) . '" height="' . intval(zen_not_null($height) ? $height : SMALL_IMAGE_HEIGHT) . '"';
    }
    }
    [/FONT]

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Suggestion to fix an image problem

    Quote Originally Posted by securit View Post
    ... when there is a leading '/'
    In what situations are you passing a leading '/' ?
    The only part of the logic in that section of the file that would relate to a problem with a leading '/' would be if you've specified a $src image file/path that doesn't exist on the server.
    As such it would seem that adjusting width/height in such a situation would be moot, since you've specified a non-existing image.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v150 Image Maps - a Temporary Fix
    By pamela631 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 7 May 2013, 11:07 PM
  2. How to fix HEADING_TITLE problem?
    By DigitalGuard in forum General Questions
    Replies: 4
    Last Post: 20 Jul 2010, 08:57 PM
  3. Help me fix header image plz
    By aleemx316 in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 4 Apr 2008, 04:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg