Pages: [1]
Tags: WEBAPP ALT CHECKFORTH DATATOCHECK IMAGENAME IMAGESDIR IMAGESURL IMG IMGSIZE ISTHERE MEMBERPICS QUOT SBURG SRC USERNAME
  Author: Topic: Gallery - Display with thumbs.
offline sburg
Last Visit: 10/18/07

Moderator
Dev
Joined: 06/30/06
Forum Posts: 144
 Gallery - Display with thumbs.
 Posted on: 07/15/06 at 09:38:50

When displaying the gallery thumbs, the thumbnails are displayed with a width of 150 regardless of the actual size. The problem occurs when you have a image that is 120x150. This works great for landscape pictures, however portraits are displayed larger than the rest.

The following change will correct the problem. I'm sure the WebAPP gurus will verify and change as needed.

Find the sub view in gallery.

Find the following section of code

code:
###
# for using image::size
                       $imagename = "$imagesdir/memberpics/$info{'username'}/$sortedfiles";
                       ($x, $y) = imgsize($imagename);

                       my $width = "";
                       my $height = "";
                       if ($x > $y) {
                             if ($x > 150) { $width = " width=\"150\""; }
                       } else {
                             if ($y > 150) { $height = " height=\"150\""; }
                       }
###

                       if ($empty ge "$data[2]") {next;}
                       $empty++;
                       $datatocheck = $info{'username'};
                       checkforth("$sortedfiles", "$datatocheck");

                       if ($th_isthere eq "1") {

                             print qq~<td class="gallery"><a href="$imagesurl/memberpics/$info{'username'}/$sortedfiles" target="_blank"><img src="$imagesurl/memberpics/$info{'username'}/$thumbnail" width="150" border="0" alt=""></a></td>~;




And add/change to


code:
###
# for using image::size
                       $imagename = "$imagesdir/memberpics/$info{'username'}/$sortedfiles";
                       ($x, $y) = imgsize($imagename);

                       my $width = "";
                       my $height = "";
                       if ($x > $y) {
                             if ($x > 150) { $width = " width=\"150\""; }
                       } else {
                             if ($y > 150) { $height = " height=\"150\""; }
                       }
###

                       if ($empty ge "$data[2]") {next;}
                       $empty++;
                       $datatocheck = $info{'username'};
                       checkforth("$sortedfiles", "$datatocheck");

                       if ($th_isthere eq "1") {
### Added the following to correct incorrect thumbnail display sburg
                             ($x_th, $y_th) = imgsize($thumbnail);
                             if ($x_th > $y_th) {
                                   if ($x_th > 150) { $th_width = " width=\"150\""; }
                             } else {
                                   if ($y_th > 150) { $th_height = " height=\"150\""; }
                             }

###                              print qq~<td class="gallery"><a href="$imagesurl/memberpics/$info{'username'}/$sortedfiles" target="_blank"><img src="$imagesurl/memberpics/$info{'username'}/$thumbnail" width="150" border="0" alt=""></a></td>~;
                             print qq~<td class="gallery"><a href="$imagesurl/memberpics/$info{'username'}/$sortedfiles" target="_blank"><img src="$imagesurl/memberpics/$info{'username'}/$thumbnail" $th_width$th_height border="0" alt=""></a></td>~;

### End of changes      





My generic signature...
get your own generic signature
Logged
       
offline bantychick
Last Visit:

Guest
 Re: Gallery - Display with thumbs.
 Posted on: 07/15/06 at 09:56:33

Thanks. The calculation I put in to make the fake thumbnails look nice and proportionate apparently didn't get into the thumbnails display. This way it will. I appreciate your contribution.
Logged
     
offline sburg
Last Visit: 10/18/07

Moderator
Dev
Joined: 06/30/06
Forum Posts: 144
 Re: Gallery - Display with thumbs.
 Posted on: 07/15/06 at 10:17:43

I try to help when I can grin



My generic signature...
get your own generic signature
Logged
       
offline bantychick
Last Visit:

Guest
 Re: Gallery - Display with thumbs.
 Posted on: 08/14/06 at 03:01:20

This is fixed in the beta. sburg fixed these Gallery bugs.
Logged
     

  Gallery - Display with thumbs.
  Bug FIXES
  Forums
  
Pages: [1]
Hop to: