Forums

Custom header pic always calls crop function (4 posts)

  1. lumin
    Member
    Posted 1 year ago #

    Having an issue where no matter what size image I upload for a custom header pic the WP crop function is always activated. The upload function states 940 X 198 px will used used as is. I can edit an image (paint.net or irfanview) to that size and even smaller. Yet when I try to upload it the crop function is activated. I can use another sites custom image sized exactly as 940 X 198 but if I edit the image even smaller the WP crop function is still activated. I can even take one of the WP stock images, try editing it to a smaller size and upload it and the crop function still activates. With the smaller, edited images I can create a pic with the same size dpi, and even file size (very near) one that does function and it still activates the crop function. I do check the file properties and there are none that exceed WP's max requirements. The crop function always attempts to reduce the width or height of the pic uploaded. This happens regardless of the file type as well.

    One more note is this occurs with the latest paint.net or irfanview as well as a previous editions. I upgraded both to see if that was the issue and it did not stop the issue from occurring.

    Am I missing something or is there a bug using paint.net and irfanview for editing pics to go in WP? I know there are other free editors available but prefer these two as they function very well with the other applications I use and prefer not to load another editor just for WP.

    Any suggestions. ideas?

  2. lumin
    Member
    Posted 1 year ago #

    As an update I emailed an image smaller than 940 X 198 PX to another WP user and asked them to try uploading it. They too are activating the crop function with that image.

  3. govpatel
    Member
    Posted 1 year ago #

    the image size is controlled by a function in functions.php

    to filter it out you can add this filter in fuctions.php just after <?php

    add_filter('twentyten_header_image_height','my_header_height');
    add_filter('twentyten_header_image_width','my_header_width');
    function my_header_height($size){
       return 182;
    }
    function my_header_width($size){
       return 822;
    }

    change the height and width to your image.

  4. lumin
    Member
    Posted 1 year ago #

    Hello govpatel,

    Thank you for the response. I did add the code and when saving it generated numerous error messages. When I loaded the image and refreshed the WEB page it printed out the following errors at the top of the displayed page. The "XXXX" is an edit for privacy.

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, '190' was given in /home/content/e/s/c/XXXXXX/html/blog/wp-includes/plugin.php on line 166

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, '939' was given in /home/content/e/s/c/XXXXX/html/blog/wp-includes/plugin.php on line 166

    This issue is driving me nuts. I can even edit one of the stock header pics to make it smaller and when uploaded it also invokes the crop function.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.