• Hi Alex,

    Is there a way to output image width and height for both images and thumbnails in both galleries and albums?

    I would insert the code in the following contexts in the gallery.php and album-extend.php where the ????????? are:

    <a href="<?php echo $gallery->pagelink ?>"><img height="<?php ????????? ?>" width="<?php ????????? ?>" class="Thumb" alt="<?php echo $gallery->title ?>" src="<?php echo $gallery->previewurl ?>"/></a>
    
    <img title="<?php echo $image->alttext ?>" alt="<?php echo $image->description ?>" height="<?php ????????? ?>" width="<?php ????????? ?>" src="<?php echo $image->thumbnailURL ?>" />
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Theo Ribeiro

    (@theorib)

    Hi, did anyone find out how to solve this?

    hi

    also spent time trying to figure this & solved

    & if anyone has a more elegant solution to this basic problem do tell

    inside image.php

    then go to
    function nggImage($gallery) {

    add

    $size = getimagesize($this->thumbURL);
    $this->tt_width		= $size[0];

    you then have a variable with a value to play off

    <li class="<?php if ($image->tt_width > 150 ) {echo 'hthumb';} ?><?php if ($image->tt_width < 150 ) {echo 'vthumb';} ?>">

    & thus can position & style landscape & portrait images

    enjoy

    Mark

    how would this work? do you have any more detail on this? sorry to be a pain. Im needing to position my image browser based on landscape and portrait photos.

    There’s an array contained within the $image object called meta_data, you can use echo $image->meta_data[‘width’] to output the width key from the meta_data array within the $Image object.

    If you use print_r($image) you’ll be able to see the full contents of the $image object.

    Hope that helps

    Sam

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: NextGEN Gallery] Getting image width and height for html img tag attributes’ is closed to new replies.