WordPress.org

Ready to get started?Download WordPress

Forums

A few questions about media uploads (4 posts)

  1. mtwelve
    Member
    Posted 2 years ago #

    Hello,

    Right... what I'm looking to do is utilize the new "Scale images to match the large size..." to resize images to a size I dictate that is not the default "Large" size.

    I've found where the new function is configured; lines 1340-1341 in \wp-admin\icludes\media.php

    var resize_height = <?php echo get_option('large_size_h', 500); ?>,
    resize_width = <?php echo get_option('large_size_w', 500); ?>,

    Now I have a temporary fix; I've replace the options it calls with some I've inserted myself... the thing is I'm editing the core files as I don't know if I can filter this...? (I presume I want to filter?) Can anyone with a stronger knowledge have a look...?

    The other thing is to make sure that the box always stays checked; or at least is checked by default. Its mentioned here as being not too tricky, any advice?

    The new uploader is fantastic and if I can just sort these two bits out then it saves using some rather temperamental code.

    Thanks

  2. mtwelve
    Member
    Posted 2 years ago #

    this set_user_setting ('upload_resize', true); in funtions.php seems to automatically check the box

  3. mtwelve
    Member
    Posted 2 years ago #

    So I was digging around on trac.wordpress.org to see if anyone else was discussing/suggesting solutions that would fix my issue. I found this but I don't think its quite relevant; is it?

    Made me think though that as there clearly isn't a filter or hook (could someone confirm which I'm searching for) to tap into then, I (we) would need to submit something and press for it to be included in the next release.

    I was thinking of something last night like this

    function set_resize_on_upload_options() {
    $resize_image_h = get_option('large_size_h', 750);
    $resize_image_w = get_option('large_size_w', 750);
    }
    
    <script type="text/javascript">
    var resize_height = <?php echo $resize_image_h; ?>,
    resize_width = <?php echo $resize_image_w; ?>,
    wpUploaderInit = <?php echo json_encode($plupload_init); ?>;
    </script>

    My patchy knowledge hints that as the variables are enclosed in a function you could just substitute that function in your own functions.php or maybe it needs a hook within the function.

    Even if Im way off any nudges in the right direction would be great so I can start a campaign to get this noticed.

    Many Thanks!

  4. mtwelve
    Member
    Posted 2 years ago #

    Can anyone poke me in the right direction?

    Should I just submit the above to get the ball rolling?

Topic Closed

This topic has been closed to new replies.

About this Topic