Progressive?

5 posts by 2 authors in: Forums > CMS Builder
Last Post: January 24, 2017   (RSS)

By TheSeen - January 17, 2017

Hi all ...

When the CMS uploads images such as jpgs are they uploaded and optimised as progressive jpgs or just standard jpgs?

Best
Adrian

By Dave - January 17, 2017

Hi Adrian, 

Standard, but we can add some code to do progressive if you'd like.  Let me know.

Thanks!

Dave Edis - Senior Developer
interactivetools.com

By Dave - January 24, 2017

Hi Adrian, 

I've added this to the next release.  If you're comfortable modifying PHP code you can try the following changes.  Be sure to create a backup file first.

  1. Created a backup of /cmsb/lib/image_functions.php
  2. Edit file and search for: save target image
  3. Add the code in red:

  // resample image
  $quality = 4; // v2.60 Speed up resizing (was 5 previously)
  _fastimagecopyresampled($targetImage, $sourceImage, 0, 0, $dst_x,  $dst_y,  $targetWidth, $targetHeight, $sourceWidth, $sourceHeight, $imageType, $quality) || die("There was an error resizing the uploaded image!");

  // enable progressive JPEGs
  imageinterlace($targetImage, true);

  // save target image
  $savedFile = false;
  switch($imageType) {

Note that only newly created thumbnails and uploads will be interlaced.  But you can go into the field editor and click "recreate" for pre-existing thumbnails if you want to regenerate them.

Let me know if that works for you!

Dave Edis - Senior Developer
interactivetools.com

By TheSeen - January 24, 2017

Magic, will give that a whirl. 

Think it's a useful feature for the next release, so well done on that. 

Cheers, as ever you guys and gals rock!

Adrian