Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Images - XC5 control of them...

 
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 07-06-2016, 01:54 AM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default 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

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!
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #2  
Old 07-08-2016, 09:54 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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?
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 07-08-2016, 09:27 PM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default 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 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
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 ) 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!).
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #4  
Old 07-19-2016, 12:41 AM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default 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 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
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:02 PM.

   

 
X-Cart forums © 2001-2020