SergeiG Posted March 23, 2017 Share Posted March 23, 2017 Hello! I prepare to add images into my site (default v6 + foundation skin) and I confused. What is optimal size/resolution for images? Also I'm trying to figure out how image cache and image resize algorithm works. I'm going to use images with 800 pixels of largest side. Is it necessary to change something in the config.xml ? In addition I see strange behavior of the engine for products page. When I open a product, I see only a half of the product image. When I refresh this page I see a full image. Screenshots are attached. How it would be possible to improve it? Thank you. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 23, 2017 Share Posted March 23, 2017 The optimal size is the largest size specified in the skin's config.xml file. For Foundation, an image 600px on the longest side is optimum. But be sure the filesize is 350K or less. CubeCart uses PHP's GD library to resize the image, saving the resized images in the cache. As for the image being cut off, there is a conversation that mentions an alternate approach to preventing the image gallery from jumping up and down. The current attempt doesn't work so well, IMHO. Quote Link to comment Share on other sites More sharing options...
SergeiG Posted March 23, 2017 Author Share Posted March 23, 2017 41 minutes ago, bsmither said: The optimal size is the largest size specified in the skin's config.xml file. For Foundation, an image 600px on the longest side is optimum. But be sure the filesize is 350K or less. CubeCart uses PHP's GD library to resize the image, saving the resized images in the cache. As for the image being cut off, there is a conversation that mentions an alternate approach to preventing the image gallery from jumping up and down. The current attempt doesn't work so well, IMHO. Thank you for the explanation. Could it be possible to disable the limitation for the filesize? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 23, 2017 Share Posted March 23, 2017 I think it's because your images are long that you are having problems. What would happen, I wonder, if the maximum width was set in config.xml to whatever your height is, instead. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 23, 2017 Share Posted March 23, 2017 I will try to find the conversation where I suggest an alternate approach. The maximum value is the longest side -- not to be assumed this is "width". A number of checks would need to be edited in the core code. That limit is in place because when editing a compressed file (JPG, PNG, GIF), the entire file needs to be loaded into memory - uncompressed. Depending on how well (or not) the image was compressed, a 350K file could decompress into memory exceeding what memory can be allocated to the task. PHP then crashes. So, a 800x800 image that is nearly uncompressable may result in a file that is approaching 350K. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 23, 2017 Share Posted March 23, 2017 Is this it? https://github.com/cubecart/v6/issues/1449 Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 23, 2017 Share Posted March 23, 2017 Yes. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 23, 2017 Share Posted March 23, 2017 I have that thread in GitHub bookmarked. I never did understand it. lol Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.