aadarshasubedi / phppi

Automatically exported from code.google.com/p/phppi
GNU General Public License v3.0
0 stars 0 forks source link

Improving speed on tablets #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
*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

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the suggestion, i'll keep this one in mind.

Original comment by gorounreal on 13 Nov 2012 at 12:53

GoogleCodeExporter commented 8 years ago
https://www.youtube.com/playlist?list=PLmfWNUkp-z0g9qqvuVVsF6rHZV4jCaO1d

Original comment by asifnan...@gmail.com on 31 Mar 2015 at 3:27