*Motivation*
Viewing full size images on a tablet or a smartphone is not comfortable because
of speed - it takes from ~5 (on a tablet) to ~10 (on a smartphone) seconds to
get the 10 megapixel/5-6 MB image ready for viewing.
*Solution*
Provide an option for scaling images down on the server to a resolution that
mobile devices can handle.
*Design*
Enhance phppi with
# a new URL parameter: size
# a new cookie: size
# set of new settings for defining resolutions for one or more supported sizes:
$this->settings['advanced']['optimized'][$size]['image_width']
$this->settings['advanced']['optimized'][$size]['image_height']
$this->settings['advanced']['optimized'][$size]['jpeg_quality']
# an option to turn optimization on/off
$this->settings['advanced']['allow_optimized_images']
# an option for setting default optimized size
$this->settings['advanced']['optimized']['default_size']
If the _size_ cookie/parameter contains a code for a know optimized size, phppi
serves the scaled image (from the cache or rescaled dynamically).
*Implementation*
See attached patch
*Results*
For the resolution set to 1024x800 optimized images are approx ten times
smaller (0.4-0.5 MB vs 5-6MB) and response time on a tabled/smartphone went
down to 1-2 sec.
Original issue reported on code.google.com by eug...@hutorny.in.ua on 27 Oct 2012 at 5:04
Original issue reported on code.google.com by
eug...@hutorny.in.ua
on 27 Oct 2012 at 5:04Attachments: