X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   General questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=66)
-   -   Images - XC5 control of them... (https://forum.x-cart.com/showthread.php?t=74167)

Triple A Racing 07-06-2016 01:54 AM

Images - XC5 control of them...
 
General questions for the QualiTeam chaps...

Images. We use jpeg images and as part of reducing various various page loading times (mainly static pages) we have just converted every single one of our own site images (!) from jpeg baseline to jpeg progressive and re-loaded them all 8O

Questions are:

When using "Generate resized images" located on the images page within Look and Feel, are the generated images provided in exactly the same format as the 'new' originals? i.e. progressive not baseline jpegs in this case? Plus, where are they stored once created? It's not in the same area as all the main images or in /var/images below as far as we can see....

Images stored in all the sub-directories below here: /var/images; what is their purpose? They date back to when their respective main images were first uploaded (a long time ago....) Re-deploying the store does nothing to them it appears, hence what purpose do they serve? If main images are changed / amended / updated etc how are the images stored in /var/images and subdirectories of same dealt with? Thanks!

qualiteam 07-08-2016 09:54 AM

Re: Images - XC5 control of them...
 
I doubt that resized images will be progressive jpegs.

/var/images directory is used to cache resized images. For example, if X-Cart knows that the active theme displays product images at X*Y, A*B and M*N dimensions, it will resize every uploaded image to these dimensions and store them for future use. Sometimes this happens not at the time when an image is uploaded, but at the time it is displayed in that particular width and height the first time.

Do you have ImageMagick installed on the server? I'm not sure if there is a solution for the GD library for PHP, but I think it can be done for ImageMagick (with a minor tweak) as is described here. So, you are to do the following:
1. Install ImageMagick on the server
2. Edit etc/config.php and specify your image_magick_path
3. From a custom module decorate the "execResize()" method in \XLite\Core\ImageOperator\ImageMagic class so that it calls the imagemagick binary with the extra "-interlace Plane" parameter.

Does this help?

Triple A Racing 07-08-2016 09:27 PM

Re: Images - XC5 control of them...
 
Quote:

Originally Posted by qualiteam
I doubt that resized images will be progressive jpegs

Thank you. That's very clear and perhaps the most important answer for everyone to know ;-) Perhaps this could be an XC5.3 suggested update?
Quote:

Originally Posted by qualiteam
/var/images directory is used to cache resized images. For example, if X-Cart knows that the active theme displays product images at X*Y, A*B and M*N dimensions, it will resize every uploaded image to these dimensions and store them for future use. Sometimes this happens not at the time when an image is uploaded, but at the time it is displayed in that particular width and height the first time

Again thanks for making this clear. If a re-sized image stored here, has a date over 12 months old, but the connected main image has been re-worked several times since it's original upload date, then we are assuming that this particular image (i.e. in this specific size) has never been requested by any site visitor? Otherwise it would be overwritten 'on demand' as a result of a verification check? Is that correct?

If not, then presumably the verification check used 'on demand' is only filename related and not file creation date / file creation time / file creation size related too, which would be far more effective 8O Therefore, one more question on this matter: If ALL the images stored in /var/images are manually deleted (we mean all the images and their subdirectories too) and then "Generate resized images" located on the images page within Look and Feel is run again afterwards, it should successfully re-create them all, but they will now all be current and correct, albeit not progressive jpegs? This deletion / replacement process won't result in any X_Cart System errors either? We don't think it should, but...
Quote:

Originally Posted by qualiteam
Do you have ImageMagick installed on the server?

Yes we do :D/
Quote:

Originally Posted by qualiteam
I'm not sure if there is a solution for the GD library for PHP, but I think it can be done for ImageMagick (with a minor tweak) as is described here. So, you are to do the following: 1. Install ImageMagick on the server 2. Edit etc/config.php and specify your image_magick_path 3. From a custom module decorate the "execResize()" method in \XLite\Core\ImageOperator\ImageMagic class so that it calls the imagemagick binary with the extra "-interlace Plane" parameter. Does this help?

Yes this is very helpful thank you, but we think we will save the effort needed to create a new module until we switch to XC5.3 later this year as a) It may not be required (if this becomes an XC5.3 CORE inclusion :lol: ) b) It will be far easier to create a new module in XC5.3 than trying to convert an XC5.2 module (you know this better than we do!).

Triple A Racing 07-19-2016 12:41 AM

Re: Images - XC5 control of them...
 
Via an XC ticket (we have several tickets currently, none are connected to this as it happens, but thought it worth a conclusion of this topic anyway FWIW) the answers are:

(Quote) "resized images are regenerated when a new image is uploaded to a product" i.e this means not at any other time e.g. using a viewing option that calls for a resized image. No details of how a 'new image' is verified :wink: but a manual re-generation does remove any doubt, which is fine.

(Edit) 'Progressive resized jpegs will currently not be produced from progressive jpeg originals via Generate Resized Images located within Look and Feel in XC5.2.* A Custom Modification can be provided if this is required' That's it in a nutshell.

We suggested this feature (standard like-for-like production) should become part of CORE XC 5.3.* i.e. progressive jpeg > resized progressive jpeg or interlaced png > resized interlaced png etc


All times are GMT -8. The time now is 01:08 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.