Goal: use imagecache to resize image that are provided to swftools playlist.

Reason: Suppose a user is using a high resolution camera and uploads images which are larger than 3MB each and are 3000x5000px. The site width is only 1024px wide, and only 1/3 of the area is used for swf gallery display. With imagecache, these images could be reduced to 100-400KB depending on several factors and still display the same quality within the smaller area provided. This would allow faster load times and considerably less bandwidth to be used.

How:
Add secondary configuration within swftools settings page or add a new display widget.

Comments

Stuart Greenfield’s picture

Hmmm, I need to think about this.

The problem is that SWF Tools was originally designed as a way to put flash on a web page. It has grown, and continues to grow. The problem is drawing the line with what SWF Tools should (or should not) do, and what other calling modules and users should do.

I can see why we might want to re-size the image, but should SWF Tools do this, or should we rely on the caller to do it?

It's kind of a philosophical debate, but it is also to do with keeping SWF Tools focussed on what SWF Tools should do, and letting other modules do what they should do.

Any thoughts?

Ron Williams’s picture

I definitely agree that we should keep SWF Tools focused on a method to insert flash into a page. This functionality needs to be integrated into the SWF Tools module to make it user friendly, but we should require users install other modules such as imagecache to actually do the image processing. Code such as http://drupal.org/node/163561#comment-1064043 could be sufficient for resizing the image based on the size the user defines for the player within SWF Tools.

Stuart Greenfield’s picture

Well, that wasn't too hard!

I've just implemented this for JW player and it was pretty straightforward.

When imagecache is enabled a new section is available on the JW configuration page, called Image cache. In there are two options - one to set the preset that should be applied to a splash image when it is rendered on the player directly, and one for images that will be used the standard playlist. Each has the option of "None" in which case no preset is applied.

It's a profile aware feature so you can have different presets on different player configurations.

Seems to be working fine - images are scaling down and the xml and source code is reflecting the appropriate imagecache path.

I'll commit JW code now, and then port it across to the remaining players over the next few days.

This will need to go in Flowplayer3, and also the image modules (image rotator and simpleviewers) to make scaling in those easy too.

I think this is probably the last "must have" feature ready for SWF Tools 6.x-3.x as now we have playlists AND optimised image handling.

Stuart Greenfield’s picture

SimpleViewer and TiltViewer are done!

Stuart Greenfield’s picture

FlowPlayer3 and ImageRotator are done.

All modules are now imagecache enabled.

The imagecache section is only visible when imagecache is enabled - I'm trying to decide whether it should be there all the time, or just display when it can be used. Not sure what's best -does anyone have a preference?!

Stuart Greenfield’s picture

Status: Active » Needs review

Changing to needs review as this is now part of queue ready closing when 6.x-3.x is released.