Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default How to use the widht / height with the zen_image function

    Hi

    I'm trying to use the zen_image function, to some images on my template. however, I might be missing something about the use of the width and height, because I get the SMALL_IMAGE values

    PHP Code:
    zen_image($src$alt ''$width ''$height ''$parameters '') { 
    This shoud work ?

    zen_image('DIR_WS_IMAGES . $my_image, $my_image_name, 100,100)

    Or I'm missing something ?

    Thanks
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  2. #2
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: How to use the widht / height with the zen_image function

    Well, 100, 100 is the width and height that you have set in the call to the image function. If that happens to also be the size of your small image, then the image will then look like the size of your small images...

    Or are you indicating that the small image which is different than any other image is the image being seen? Ie. Small image is a view from the left, other images show a different perspective...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: How to use the widht / height with the zen_image function

    Quote Originally Posted by mesnitu View Post
    Hi

    I'm trying to use the zen_image function, to some images on my template. however, I might be missing something about the use of the width and height, because I get the SMALL_IMAGE values

    PHP Code:
    zen_image($src$alt ''$width ''$height ''$parameters '') { 
    This shoud work ?

    zen_image('DIR_WS_IMAGES . $my_image, $my_image_name, 100,100)

    Or I'm missing something ?

    Thanks
    remove the single quote before DIR_WS_IMAGES..
    Code:
    zen_image('DIR_WS_IMAGES . $my_image, $my_image_name, 100,100)
    and try
    Code:
    zen_image(DIR_WS_IMAGES . $my_image, $my_image_name, 100,100)

  4. #4
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: How to use the widht / height with the zen_image function

    Hi
    Thanks
    I gave a bad example, I see now I was not getting the right values ie: (400,200) , because the proportional images configuration was set to true.
    So, if I use a , ie:

    zen_image( DIR_WS_IMAGES . $publisher_menu->fields['publisher_image'], $publisher_menu_name,400,100, 'property="image"');

    It's calculated by the height, and I get a 100x100 img.
    But, not using the proportional images for the all site, it's a big headache.
    Probably, my best option it's to alter the zen_image for this specific use.

    Thanks
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  5. #5
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: How to use the widht / height with the zen_image function

    Quote Originally Posted by mesnitu View Post
    Hi
    Thanks
    I gave a bad example, I see now I was not getting the right values ie: (400,200) , because the proportional images configuration was set to true.
    So, if I use a , ie:

    zen_image( DIR_WS_IMAGES . $publisher_menu->fields['publisher_image'], $publisher_menu_name,400,100, 'property="image"');

    It's calculated by the height, and I get a 100x100 img.
    But, not using the proportional images for the all site, it's a big headache.
    Probably, my best option it's to alter the zen_image for this specific use.

    Thanks
    What are the dimensions of the original image? Are you trying to elongate or stretch the image?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: How to use the widht / height with the zen_image function

    I still don't' have a particular use, just trying to understand, to see if it was possible to use this function in some template cases.
    for ie:
    A image with 800x542

    But lets say, for some reason, I wanted to be 500x100
    zen_image(DIR_WS_IMAGES . 'image.jpg', 'somenthing',500,100);
    It gets calculated and I'll get 148x100. I could by css give my width.

    If I use
    <img src=<?php echo '"'.DIR_WS_IMAGES . 'image.jpg" width="500" height="100"';?>>
    I get 500x100px

    I want to have zencart proportional images in 98% ,so I'll be using the <img> if I need to be out of proportional images.

    Thanks
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

 

 

Similar Threads

  1. v154 zen_image: Why the extra spaces in the title= attribute?
    By lat9 in forum General Questions
    Replies: 8
    Last Post: 11 Sep 2019, 05:51 PM
  2. Replies: 6
    Last Post: 25 Oct 2013, 10:43 PM
  3. how do I decrease the height of the top banner or header
    By alma1 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 17 Jul 2008, 01:54 AM

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