In July 2020 I wrote about resizing images using a php script called Simple Image (https://community.sellerdeck.com/for...830#post552830)
I have been developing the concept and along with some valuable input from Norman regarding using the script with a Bootstrap site (Swift for example) am now using the following way of serving scaled images appropriate to viewport. It also gives the appropriate width and height for each image which also helps SEO.
You need to download the simpleImage.php script from https://github.com/claviska/SimpleImage
Please note, this is now version 3.6.3 and it differs from earlier versions in having the line
So that when the script is called you need to use:
and not as previously:
You need to create a folder in the Site folder called 'scaled'.
The layouts that are modified are as follows:
Before you start take a site snapshot!
Then copy these layouts in the design library so you have backups:
Zipped txt files of the layouts here: https://www.graphicz.solutions/Simple-Image-Layouts.zip
Finally take a look in the stylesheet for
And edit it thus:
By all means use and develop as you wish but remember this is posted in good faith without any warranty or guarantee express or implied.
Thank you.
I have been developing the concept and along with some valuable input from Norman regarding using the script with a Bootstrap site (Swift for example) am now using the following way of serving scaled images appropriate to viewport. It also gives the appropriate width and height for each image which also helps SEO.
You need to download the simpleImage.php script from https://github.com/claviska/SimpleImage
Please note, this is now version 3.6.3 and it differs from earlier versions in having the line
Code:
namespace claviska;
Code:
$image = new \claviska\SimpleImage();
Code:
$image = new SimpleImage();
The layouts that are modified are as follows:
Before you start take a site snapshot!
Then copy these layouts in the design library so you have backups:
- Best Seller
- Home Page Section List
- New Product
- Product Summary Image
- Standard Product Image
- Standard Promotional List Entry
- Top Level Section
Zipped txt files of the layouts here: https://www.graphicz.solutions/Simple-Image-Layouts.zip
Finally take a look in the stylesheet for
Code:
img { max-width: 100%; max-height: 100%; }
Code:
img { max-width: 100%; max-height: 100%; height:auto; }
Thank you.
Comment