[Resolved] Page Header Hard Crop Image Size

Home Forums Support [Resolved] Page Header Hard Crop Image Size

Home Forums Support Page Header Hard Crop Image Size

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #47748
    Teut0

    Hey there!

    When i use an image as header it works well and has the size of the image uploaded.

    But when i use the hard crop function it makes it like 10 times larger.

    example: no hard crop: 64 kb .. using hard crop: 640 kb

    Do you have any idea how to solve that problem?

    Cheers

    #47800
    Tom
    Lead Developer
    Lead Developer

    Wow – not sure that’s even possible, if anything it should reduce the size considerably.

    For example: http://i.imgur.com/zB9DBgb.jpg

    Image on left hasn’t been hard-cropped, while the image on the right was hard cropped.

    Do you have an example of this anywhere that I can see?

    #47805
    Teut0

    Hi!

    When i dont use this function and click on the image it shows the image uploaded in the media-section.

    But when it is hard cropped and i click on the image.. it adds http://xxx.xx/wp-content/uploads/bfi_thumb/ and some random numbers and suddenly it is like 10 times larger.

    Also when i test it with google pagespeed it shows how large the image actually is and gives like 10 points less than without using the hard crop.

    Shallshal i pm you my website?

    #47806
    Tom
    Lead Developer
    Lead Developer

    Hmm, sure – you can email it to me at support@generatepress.com.

    You’re getting these results using the Page Header addon?

    #47922
    Tom
    Lead Developer
    Lead Developer

    After taking a look at this, it seems to be happening when you set a hard crop to a larger image size than the original.

    In your case, the original image 1024px wide, while your hard-crop is 1200px wide.

    This will definitely add some size to the file, and the extra is probably coming from the fact that the resizer is built to re-size down, not up.

    See if resizing the image down has the same effect πŸ™‚

    #48069
    Teut0

    That sounds logical, but resizing down has the same effect.

    I uploaded an 1500 x 803 px large image (230 kb), resized it to 1300 x 700 px and suddenly it was over 1 mb large..

    It seems like the bigger you make it, independent from the original size, the larger it will be.

    Can you reconstruct this?

    Thanks for your fast and good support!

    #48129
    Tom
    Lead Developer
    Lead Developer

    Interesting – I can’t re-construct, but it might be a hosting thing?

    The resizing script is BFI Thumb: https://github.com/bfintal/bfi_thumb

    I’ll do some more digging around in the morning and see if I can find anyone else who’s experiencing this πŸ™‚

    #48280
    Tom
    Lead Developer
    Lead Developer

    Do you have another server somewhere where you can test this? I’m curious to know if it’s a server thing, as I can’t reproduce, and it doesn’t seem like anyone else using this resizing script has encountered it.

    #48316
    Teut0

    Hey

    I tested it ony my local system.

    Just Generatepress and the plugin installed, under the same circumstances.

    -> Same result.

    Dont worry about it πŸ™‚ I’ll find a workaround..

    Thank you though!

    #48318
    Tom
    Lead Developer
    Lead Developer

    Hmm, I’ll do some more looking around too.

    #60775
    Martin

    Hi,

    I’m having the same problem as Teut0. My Page Header image will be converted to a .png which is 3x-4x bigger than the origin .jpg.
    I could workaround this behaviour by disabling the hard crop but unfortunately then the image is not visible with Internet Explorer 10. Internet Explorer 11 works and also IE10 emulation in IE11 works. The problem seems to be the height="1" and width="1" attributes of the <img> tag
    Example for IE10 and hard crop disabled: http://historischedampftechnik.de/

    Cheers

    #60802
    Martin

    Found a solution:

    BFI Thumb changes the extension to png if opacity is set:
    https://github.com/bfintal/bfi_thumb/blob/master/BFI_Thumb.php#L620

    After removing line 216 from gp-premium/addons/generate-page-header/inc/functions.php and changing line 218 to 'quality' => 95, with hard crop enabled I get jpg again and the filesize is also smaller. Maybe you can add the params of BFI Thumb to the configuration of Page Header?

    Cheers

    #60902
    Tom
    Lead Developer
    Lead Developer

    Hi Martin,

    Great find! I’ll make this adjustment today!

    Thanks a lot πŸ™‚

    #61210
    Tom
    Lead Developer
    Lead Developer

    I’ve made this adjustment to the next version of GP Premium/Page Header.

    Thanks again!

    #61418
    Martin

    Thanks

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.