ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Photo Gallery resizing: How can I set width to be main resize factor instead of height?

August 11, 2008 12:37pm

Subscribe [1]
  • #1 / Aug 11, 2008 12:37pm

    Carlo Poso

    35 posts

    This question may be related to a resolved thread.

    Hi all,
    looks like this is not working for me.
    I have EE 1.6.4 installed.

    I’ve just modified my core.img_lib.php:

    class Image_lib {
    
    var $resize_protocol    = 'gd2';      // Can be:  imagemagick, netpbm, gd, gd2
    var $maintain_ratio        = TRUE;      // Whether to maintain aspect ratio when resizing or use hard values
    var $master_dim            = 'width';    // height, width, or auto (auto adjusts the dimension based on whether the image is taller then wider or vice versa)
    var $dynamic_output        = FALSE;    // Whether to send to browser or write to disk
        var $thumb_prefix        = '';
        var $file_path            = '';
        var $file_name            = '';
        var $new_file_name        = '';

    Look at the attached img for the Pref Panel.

    If I upload a new photo which, let’s say, is 560x1200, the resizing engine resizes it at the size specified in the prefs (in this case 400x300), instead of doing a 400x857 pic…

    Please help!

    Carlo

  • #2 / Aug 11, 2008 12:48pm

    Robin Sowell

    13255 posts

    Hm- right, I’d expect the 400x857 if using width.  What’s the build number you’re on?  And are you positive you overwrote the old file after you made the tweak?  Might try deleting it, then uploading a fresh copy w/it set to width.

  • #3 / Aug 11, 2008 12:53pm

    Carlo Poso

    35 posts

    Hi there,
    I’m on build 20080626.
    I’m deleting and uploading the file againg…
    I’ll tell you something in a moment…

  • #4 / Aug 11, 2008 12:57pm

    Carlo Poso

    35 posts

    Nada…doesn’t work…
    :(

  • #5 / Aug 11, 2008 1:31pm

    Robin Sowell

    13255 posts

    Hm- seemed to on mine- had a tall skinny one (10px × 320px), set max thumb size to 50x37, resized image is 50px × 1600px.  But- may not be a brilliant test.  Want to attach one that’s failing on you, could try with that.

  • #6 / Aug 12, 2008 4:30am

    Carlo Poso

    35 posts

    Ok, try with this.
    Carlo

  • #7 / Aug 12, 2008 10:32am

    Robin Sowell

    13255 posts

    Good deal- that match the one you were testing with?

    OK- still look like it worked fine on mine.  Thumb comes out 50px × 71px - direct link.  If you do the same image- what are you coming up with on resize- with master dimension set to width?

  • #8 / Aug 12, 2008 10:40am

    Carlo Poso

    35 posts

    Hi Robin,
    the problem I have deals with the medium_size image, not the thumbnail…
    Am I getting something wrong about the core.image_lib.php file?
    I mean, does the $master_dim variable relate to the _thumb, the _medium size or both?

    Carlo

  • #9 / Aug 12, 2008 10:45am

    Carlo Poso

    35 posts

    BTW
    Look here (click on the thumb)

    http://claraegigipadovani.orange021.com/index.php/sito/libro-dettaglio/conoscere-il-cioccolato/


    I’ve set thumb size at 50x37, medium size ar 400x300 and $master_dim is set to width.

    Carlo

  • #10 / Aug 12, 2008 11:01am

    Robin Sowell

    13255 posts

    $master_dim will apply to both.  Right now, my thumb is set to 50x37, medium is 400x300.  Maintain aspect ratio is checked. 

    Works for both medium and thumb.  Heh- and I just spotted it.  Click ‘Maintain aspect ratio’ in your settings.  That should do the trick.

  • #11 / Aug 12, 2008 11:19am

    Carlo Poso

    35 posts

    AHAH!
    That was the problem, the “Mantain aspect ratio” radio button.

    Thanks Rob!

  • #12 / Aug 12, 2008 12:05pm

    Robin Sowell

    13255 posts

    Sorry about that- I really should have spotted it sooner.  The screen capture was a little small in my monitor and I didn’t notice it first go round.

    Glad you’re squared away now!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases