Images with same height

Aktarus

Joined: 2005-08-07
Posts: 22
Posted: Sun, 2005-08-07 16:06

First of all, gallery is great.

But there's one thing I could not solve until now.
When uploading images it is only possible to give one size for thumbs, e.g. 160 px.
Landscape pictures are uploaded 160x120 and portrait are uploaded 120x160. Showing the album the height of the lines is different depenging if there's an portrait image included or not. That's not the big problem.

But viewing each image with a given size of 700 landscape images are displayed without scrolling. But each portrait image has to be scrolled to the bottom of the page.
Is is possible also to define a maximum height for each image.
Define height 450, landscape is uploaded as 600x450 (no scrolling) and portrait is uploaded as 370x450 (no scrolling) instead of 450x500 (scrolling).

I would be glad if it is possible or someone could tell me where's the best place in code to do this (but then I have to do it again with each new version).

Regards,
Aktarus

 
anna_d

Joined: 2005-05-01
Posts: 29
Posted: Sun, 2005-09-04 14:53

I think someone's made a way to do this, but I don't know what it is and don't think it's a current hack anyway.

Myself, I'd especially like to be able to automatically make the album highlight images all the same width. At the moment I just always use landscape or square images for album highlights to keep them all the same width.

 
Aktarus

Joined: 2005-08-07
Posts: 22
Posted: Wed, 2005-09-07 17:03

Unfortunately it's hard to do this with a "hacked" version of G2 because too many files have to be modified.
Therefor I just made a dirty change in NetPbmToolkit.class in function performOperation():
case 'scale':
$ysize = empty($parameters[1]) ? $parameters[0] : $parameters[1];
// add next line
if ($operationName == 'thumbnail'){$ysize=150;}

For thumbs only one size can be given (width) and heigth is always set to the same value. Therefor thumbs have neither same width nor same height if portrait and landscape is mixed.
I want them all to have a width of max. 200 and always a height of 150.
200 can be set in the theme for thumbnails size.

I set $ysize =150 in the code above.
This creates a rectangle of 200x150 in that each image has to fit. Landscape fills this rectangle completely whereas portrait only fills the height.

To make all images same width just set the height to a big value as 1000.
Portraits will be resized to 200x266 and landscape to 200x150 (assumed that images have a relation of 4:3).

I hope that sometime in the near future there may be a version of G2 available where for thumbs a rectangle can be specified (add height) as for scaled images.

Aktarus

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Wed, 2005-09-07 17:09

Have you tried simply using the Square Thumbs module in G2?

 
Aktarus

Joined: 2005-08-07
Posts: 22
Posted: Thu, 2005-09-08 16:16

Yes but it didn't work as I wanted because I don't want to define a square (200x200) and also don't want images to have a changed relation height:width.
I need a real rectangle 200x150 where each image has to fit.