Tall Vertical Images = small thumbs
cryonix - December 18, 2007 - 13:04
| Project: | Brilliant Gallery |
| Version: | 5.x-2.15 |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | cryonix |
| Status: | needs review |
| Issue tags: | Newbie |
Jump to:
Description
I didn't see this brought up.
Tall Vertical images appear to display improperly as thumbnails. They are extremely small compared to other horizontal oriented images.
excuse the format for this portion
I dont know PHP but after looking through the files, perhaps...
(after "check if vertical" get size ratio)
ImgHeight/ImgWidth=HWratio
(then set the dimension for the thumb)
ImgHeight=maxWidth
ImgWidth=maxWidth*HWratio
not sure if this is what you're already doing since I only understood snippets of what i was looking at :)
Example gallery(still developing the site)
I'm an artist which lead to many of my works not having "standard" ratios.
Everything else is works wonderfully!
thanks
~Curtis

#1
Figured it out myself:
If anyone else has had this problem this is what i did to fix it.
I hit up a few PHP tutorials to learn how to read the "brilliant_gallery.module" file. Then I figured out what was wrong.
Original file reads on lines 316 317
$imgw = round( ($temp[0]/$temp[1])*($temp[0]/$temp[1])*$imagewidth );$imgh = round( ($temp[0]/$temp[1])* $imagewidth);
which can be simplified to the following while fixing the main problem mentioned previously
$imgw = round( ($temp[0]/$temp[1])*$imagewidth );$imgh = $imagewidth;
Now let me reiterate that I dont know php and this was a shot in the dark for me. If there is a better/existing fix please let me know.
~Curtis
#2
Hi,
I still have the same problem in BG 6.x-3.4, seems it is not fixed yet.
Strange that if W/H = 1, it shows the image with full width, and if W/H decreases, the thumbnail is getting smaller and smaller.
Changing the calculation in row 85 and 87 of functions.inc helped.
// This is a vertical image
$retval_dimensions[$poct]['imgw'] = round(($temp[0] / $temp[1]) * ($temp[0] / $temp[1]) * $imagewidth);
$retval_dimensions[$poct]['imgh'] = round(($temp[0] / $temp[1]) * $imagewidth);
B