Photo Gallery resizing: How can I set width to be main resize factor instead of height? 
Posted: 02 July 2008 02:26 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  819
Joined  12-14-2004

In the EE gallery resizing preferences for thumbnails, you can give dimensions that you want it to adhere to. The problem I have been having is that EE has been resizing with preference being on the height.

What i mean is, if I say I want a max image of 575x350, and something doesn’t meet that ratio exactly, I might get an image that is 630x350. However, I would rather get an image that is 575x280 (or whatever the ratio would turn out to be).

Right now, EE makes sure that when it resizes, it matches up the height. Instead, I want it to resize and make sure the images are no wider than 575, even if it means a height less than 350.

That make sense?

Now, here is why - notice how the resized image is coming out of the template here:

http://www.gearlive.com/news/article/q208-exclusive-macbook-air-vs-voodoo-envy-133/

 Signature 

Love gadgets, technology, and pop culture? Visit us at Gear Live: http://www.gearlive.com

Profile
 
 
Posted: 02 July 2008 02:43 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12887
Joined  05-15-2004

Didn’t we have this issue a couple of days ago? EE defaults to using height as the master dimension for resizing. To change this, you will have to open /system/core/core.image_lib.php and find the line:

var $master_dim    = 'height'; // height, width, or auto (auto adjusts the dimension based on whether the image is taller then wider or vice versa)

Change that to “auto” or, in your case, “width”.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 03 July 2008 12:58 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  819
Joined  12-14-2004

Not sure if you had this issue a couple of days ago, but I sure didn’t, as this is the first time I ever asked this question.

Thanks for the tip - very cool. However, I take it that since I am having to editing the PHP file instead of having something in the control panel, that I am going to need to remember to edit this file anytime that I upgrade EE?

Would a feature request be appropriate, in terms of asking for this to be something that is changed in the CP instead of in the file?

 Signature 

Love gadgets, technology, and pop culture? Visit us at Gear Live: http://www.gearlive.com

Profile
 
 
Posted: 03 July 2008 01:11 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12887
Joined  05-15-2004
drusoicy - 03 July 2008 12:58 PM

Not sure if you had this issue a couple of days ago, but I sure didn’t, as this is the first time I ever asked this question.

Right. I comes up from time to time, and I vaguely remembered a recent case, but it clearly didn’t involve you.

Thanks for the tip - very cool. However, I take it that since I am having to editing the PHP file instead of having something in the control panel, that I am going to need to remember to edit this file anytime that I upgrade EE?

Every time you replaced that file, yes.

Would a feature request be appropriate, in terms of asking for this to be something that is changed in the CP instead of in the file?

By all means! Perhaps a hidden variable in config.php would be sufficient, the way we do it with a few other variables. But, yes, a FR is certainly appropriate. You can probably find an existing one and add your voice to it.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 03 July 2008 02:37 PM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12887
Joined  05-15-2004

See the FR pertainning to this here. Marking as “Resolved”.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 60677 Total Logged-in Users: 39
Total Topics: 73095 Total Anonymous Users: 29
Total Replies: 394190 Total Guests: 472
Total Posts: 467285    
Members ( View Memberlist )
Newest Members:  ivamolsindbadlabuddhi.caprakash123connexionsMaxim GuisoveggtartFoliovenenmruMplourde