Archived topic
Page Header Hard Crop Image Size
14 replies · Started by Teut0 on November 20, 2014
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
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?
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?
Hmm, sure - you can email it to me at support@generatepress.com.
You're getting these results using the Page Header addon?
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 :)
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!
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 :)
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.
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!
Hmm, I'll do some more looking around too.
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
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
Hi Martin,
Great find! I'll make this adjustment today!
Thanks a lot :)
I've made this adjustment to the next version of GP Premium/Page Header.
Thanks again!
Thanks