Changing Resize to to work on width, not height - how?

bkburns

Joined: 2004-03-09
Posts: 3
Posted: Mon, 2005-03-21 04:52

Hey Everyone,

It appears to me that the resize on upload function resizes based on a height constraint. For example, if I have the system set to '500' it will resize the system to be under 500 pixels tall.

Can anyone suggest how I would modify this to resize based on the horizontal rather than the vertical?

Thanks in advance for any suggestions,

Brian

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Mon, 2005-03-21 07:11

a search of the forum ( gallery customizers best friend ) revealed

http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=22603&highlight=image+resize

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Mon, 2005-03-21 07:29

Also, it doesn't resize height or width... it resizes which ever of the two dimensions is greatest. So an image that is 1000x500 will become 500x250, but an image that is 500x1000 will become 250x500.

So if it is a landscape (long) image, it will be resizing based on the length. If it is a portrait (tall) image, it will resize based on the height.

So as you can see, since its not basing the resize on either the horizontal OR the verticle, but rather which ever is greater... you need to ask another question and/or modify gallery with that in mind.

 
bkburns

Joined: 2004-03-09
Posts: 3
Posted: Mon, 2005-03-21 21:33
khsjr1970 wrote:
a search of the forum ( gallery customizers best friend ) revealed

http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=22603&highlight=image+resize

Khsjr1970 - I had previously searched and found myresize. It does not do what I am looking for. It resizes albums to fit constraints and loses the original. Plus it is an additional step.

fryfrog wrote:
Also, it doesn't resize height or width... it resizes which ever of the two dimensions is greatest. So an image that is 1000x500 will become 500x250, but an image that is 500x1000 will become 250x500.

So if it is a landscape (long) image, it will be resizing based on the length. If it is a portrait (tall) image, it will resize based on the height.

So as you can see, since its not basing the resize on either the horizontal OR the verticle, but rather which ever is greater... you need to ask another question and/or modify gallery with that in mind.

Thanks FryFrog. Now that you mention it, I went back and looked at my gallery and noticed the behavior as you describe. I guess I only noticed the pictures that were hanging out the edge of my div tag horizontally as my web layout stretches vertically.

With that being said, any suggestions how/where to modify the resize behavior so that it always resizes based on a horizontal max width constraint?

Thanks again,

B

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Mon, 2005-03-21 22:22

-edit- for leading in the wrong direction.

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Mon, 2005-03-21 22:43

Well, actually it does. Gallery was written to shrink the dimension that was greatest. So if you dont want any images that are over 600 pixels wide, set it to this. If you don't want images that are heigher than 600 pixels, set it to 600 pixels.

If you want them to ALWAYS be 600 pixels wide and some OTHER number tall (related and proportional) you will have to go code diving... and I have no idea where. Probably finding the thumb/sized generation functions and hard coding them to width would be enough if you don't mind it being a hackish change.

 
djbis

Joined: 2004-02-25
Posts: 64
Posted: Thu, 2007-07-19 00:26

Hello folks, I am looking for the exact same solution that bkburns came here for.

I want to be able to upload photos and have their resized derivates on G2 be based on widths, instead of the greater of the pictures dimension...

For photos that are in portrait position all of my dimensions are being applied to the height right now. If I was knowledgeable enough to dive into Gallery's code and make the change to "width" only I would but I don't even know where to start looking.

Your help is appreciated.

PS: another idea (maybe something like this exists already?) would be to allow users to put a (*) symbol on either the heigh or width as a way of letting gallery know to observe the other number that was input as the maximum resize size.

I tried to use 0 for height and also left the height field empty but gallery did not accept them as sizes. But I guess that would work as well.

 
djbis

Joined: 2004-02-25
Posts: 64
Posted: Thu, 2007-07-19 00:49

bkburns, i realize you posted this back in the day and that you may have already found your answer... if you did I would love to hear how you got it to work, if you didn't I just figured it out:

• For the width enter what you want the widths to be, for the height just enter 100% as the size!

NICE!

PS: I am working with G2 just in case.