Index Help

DynamicResize

Average rating :
not rated yet

  • Author: arno1
  • Categories: Plugin
  • First revision date: 2011-09-18
  • Latest revision date: 2011-09-18
  • Available languages: 1 (see)
  • Compatible with: Piwigo releases 2.2
  • Downloads: 1567
Français [FR]

About: Boost your Piwigo Photo Gallery!

'DynamicResize' allows you to add the following functions:

- Resize on the fly, server side of the photo, depending on the final size of the photo.
Ex: Your source photo is 1280 * 1024 on the server side, but the client can only display 640 * 512?
The image is resized to live on the server side in 640 * 512, which leads to a download four times faster!
(The computation time being about 1/10th s, depending on the resources of the machine, the size of the original photo, etc.)

- Prefetching (preloading) of the following photo: After the current photo is loaded, the loading of the next frame starts, always in the right format.
=> The transition to the next photo is almost instantaneous!

=> Does not affect the loading time of the first photo, nor the bandwidth (asynchronous) nor the amount of data transmitted. (In most cases the visitor would actually see the next photo)

- Resized photo are cached so if a photo is accessed more than once the resized photo is already available.

- Since the photo is not regenerated, the server will not reload the photo, sending a "304 not modified" message. This saves on bandwidth.

- URL of photo is "friendly" even though generated by php, the photos are widely used jpg format.

Specific uses:
- No need to designate web or high-resolution photo! It is most embarrassing to have very large pictures like 1600 * 1200 in "web size"!
(At least for navigation, since there are more differences between the two types - including rights management)

- Ideal for smartphones! With the lower resolution, the loading is fast!

WARNING - WARNING - WARNING
This technique intensively uses the host CPU. This plugin is not recommended for those who do not have unlimited resources at their hosts, especially in case of shared hosting and small or less powerful NAS. You may want to book the processing time on the host until the host gives feedback on this.

Some technical details:

- At the moment, this plugin is calculated based on the available screen size. The theme 'stripped' or the plugin 'autosize' is essential for 'DynamicResize' to work.

- The first photo is not resized, since the size is not yet calculated. It will be (optional?) in a future version to use an "XHR" technique for the first photo.

- This plugin uses the open source library 'SLIRE,' which manages the resizing.

- It's highly recommended to enable Mode_rewrite on the server for the writing of photo URLs.

Plugin is being finalized, feel free to comment on http://fr.piwigo.org/forum/viewtopic.php?id=20934
Let us know how it works for you!

Related links

Revision list

expand/collapse all

Revision 0.2 1567 Downloads, Released on 2011-09-18
Download revision 0.2

Compatible with: 2.2

New languages: Français [FR] Total : 1

Français [FR]

First public version - for testing only.

REMINDER: Do not use if you have shared CPU resources on the host - may consume lots of CPU

Some known issues:
- "Blinking" of the photo when loading, before resizing. (?)
- Calculating the size works well with the 'Stripped' theme. I had some problems (with a few pixel) with the 'Autosize' plugin. Will followup on this.
- With 'Stripped,' I had a concern about the calculation of the vertical photo size (need to reproduce / confirm).
- The first photo needs to load in "XHR," so ...
- For now 'SLIRE' uses GD - not ImageMagick - which is a pity. Plan to use it in the future, or tweak 'SLIRE' or duplicate its functions.
- Draft code - needs cleaning and polishing
- Need to add options in admin
- Code not implemented in the event space is vertical rather than horizontal (iPhone, ..). This will be implemented later.

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact