AbanteCart Community

Shopping Cart Operations => Support => Topic started by: llegrand on May 05, 2015, 05:49:27 PM

Title: optimizing graphics seem to be overridden somehow
Post by: llegrand on May 05, 2015, 05:49:27 PM
I am working in a new clean install of 1.2.1.

It seems there is something that is overriding my image file sizes.  I have optimized my images to increase my page load speeds,  but something seems to be re-doing them.

Here's an example,  I uploaded a product image of 300 x 300 optimized to 25.7KB,   but when I check image sizes on the home page it comes up at 250 x 250 for 244.84  KB  and all the images on the home page regardless of what I have for the upload to the resource library seem to use that size.  If i check the resource library  it is 100 x 100 for 39.28 KB

What is re-sizing the uploads?  I have not encountered this with previous versions so am "concerned" with the 1.2.1 as it is negatively impacting my page load speeds.

After doing a little more testing  I am only having the issue with .png images,   jpg is working correctly.  So now I am more confused!  Should we not be using png?


thanks.
Lee
Title: Re: optimizing graphics seem to be overridden somehow
Post by: abolabo on May 05, 2015, 07:19:53 PM
no. Abantecart resize images by request. On storefront you see thumbnails. You original png saves as-is. You can check it size in Resource Library on admin-side, just click "preview".
i guess issue is in core/lib/image.php.
Can you post url of your png?
Title: Re: optimizing graphics seem to be overridden somehow
Post by: llegrand on May 05, 2015, 09:09:34 PM
Okay,  here's a clean test for you  -  http://wehearyou2.com/test121/ (http://wehearyou2.com/test121/)

Look in the latest products

blue image png  uploaded 500 x 500 77 KB  in resources  shows 100 x 100 thumbnail  39.28 KB  Home page 250 x 250 244.84 KB

red image jpg uploaded  500 X 500 57.5 KMB in resources  shows 100 x 100 thumbnail  13.07 KB  Home page 250 x 250 55.5 KB


this is just something I don't understand. 

Lee
Title: Re: optimizing graphics seem to be overridden somehow
Post by: abolabo on May 06, 2015, 11:37:25 AM
core/lib/image.php

Please check attached file
Title: Re: optimizing graphics seem to be overridden somehow
Post by: llegrand on May 06, 2015, 12:03:35 PM
I have checked that file against the one in the installed cart (a virgin install with nothing changed in the files)using a compare tool.

They are identical.   So what's next?

By the way I tested this on the demo installed also,  and it has the same result.


Title: Re: optimizing graphics seem to be overridden somehow
Post by: abolabo on May 06, 2015, 12:11:55 PM
i added optimizing process for png into image.php .
To test you need:
- replace core/lib/image.php
- clear thumbnails via admin->system->cache->clear images
- open storefront ( your thumbnails will be recreated)
- check size
Title: Re: optimizing graphics seem to be overridden somehow
Post by: llegrand on May 06, 2015, 12:56:26 PM
okay,  have done all that -  actually did it three times to be really sure I used the correct file

I am getting the same size on the home page -  I have added one more - the Abantecart Logo,  and it behaves the same.
It seems is does not matter what size the image is,  the 250 x 250 goes to the same size on png files.  244.84
Title: Re: optimizing graphics seem to be overridden somehow
Post by: abolabo on May 12, 2015, 12:32:01 PM
try this variant https://github.com/abantecart/abantecart-src/blob/1.2.2/public_html/core/lib/image.php.
it works for me