Jump to content

Choosing the original image size. Resize algorithm


SergeiG

Recommended Posts

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.

 

1st_time.jpg

after_refresh.jpg

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...