Thread: image size

Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Posts
    32
    Plugin Contributions
    0

    Default image size

    hey well i've been editing the additional images, and now ive found the code that wuses javascript to grab the width and height of the image and put it onto the page, here is the code.

    Code:
    // Build output based on images found
    $num_images = sizeof($images_array);
    $list_box_contents = '';
    $title = '';
    
    if ($num_images) {
      $row = 0;
      $col = 0;
      if ($num_images < IMAGES_AUTO_ADDED || IMAGES_AUTO_ADDED == 0 ) {
        $col_width = floor(100/$num_images);
      } else {
        $col_width = floor(100/IMAGES_AUTO_ADDED);
      }
    
      for ($i=0, $n=$num_images; $i<$n; $i++) {
        $file = $images_array[$i];
        $products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
        $flag_has_large = file_exists($products_image_large);
        $products_image_large = ($flag_has_large ? $products_image_large : $products_image_directory . $file);
        $flag_display_large = (IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE == 'Yes' || $flag_has_large);
        $base_image = $products_image_directory . $file;
        $thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
        $thumb_regular = zen_image($base_image, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
        $large_link = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large);
    
        // Link Preparation:
        $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
    
        $noscript_link = '<noscript>' . ($flag_display_large ? '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large) . '" target="_blank">' . $thumb_regular . '<br /><span class="imgLinkAdditional">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' : $thumb_regular ) . '</noscript>';
    
        //      $alternate_link = '<a href="' . $products_image_large . '" onclick="javascript:popupWindow(\''. $large_link . '\') return false;" title="' . $products_name . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';
    
        $link = $script_link . "\n      " . $noscript_link;
        //      $link = $alternate_link;
    
        // List Box array generation:
        $list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . '',
        'text' => "\n      " . $link);
        $col ++;
        if ($col > (IMAGES_AUTO_ADDED -1)) {
          $col = 0;
          $row ++;
        }
      } // end for loop
    } // endif
    now i know that these hold the values,
    SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT however all i want to do is half with height and with automatically because the images are a bit to big can anyone think a way around it ?

  2. #2
    Join Date
    Sep 2008
    Posts
    32
    Plugin Contributions
    0

    Default Re: image size

    soz for boulde posting i know is exactly where the values is coming from, but ic an't find where it is held so i can edit the code.

    $thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);

  3. #3
    Join Date
    Jan 2007
    Location
    1.5 miles from Home
    Posts
    674
    Plugin Contributions
    0

    Default Re: image size

    Quote Originally Posted by dean5000v View Post
    soz for boulde posting i know is exactly where the values is coming from, but ic an't find where it is held so i can edit the code.

    $thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);

    Real easy.
    Admin-->Configturation-->Images
    Why edit the code? You can make image size changes here (also where the size is stored).
    Want it to scale correctly, enter either the height or width and leave the other at "0" (zero).
    ie.. Height = 100 Width = 0

    M
    Last edited by tophand; 16 Oct 2008 at 07:50 AM.

 

 

Similar Threads

  1. v150 matching image size to box size so that image doesn't tile
    By cyberbaffled in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 Jul 2013, 02:08 PM
  2. Pop up image size.. image right size, window too small
    By grayceworks in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 18 Dec 2011, 06:25 AM
  3. Produc/Category Image - limiting image size and type
    By nigelt74 in forum Customization from the Admin
    Replies: 3
    Last Post: 13 Jul 2009, 03:08 AM
  4. product image size - how do you display the original size?
    By abcdabcd in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 6 Aug 2007, 04:49 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