Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » proportional scaling of thumbnails in filepicker (for images)
proportional scaling of thumbnails in filepicker (for images) [message #1461] Mon, 14 July 2008 10:35 Go to previous message
ikatz is currently offline  ikatz
Messages: 40
Registered: December 2007
Location: Durham, NH
Member
I am trying to make my image filepicker easier to use. I am storing company logos of all shapes and sizes, so there is no single width/height combination that I can use; some logos will appear squashed in the filepicker screen.

I was able to get the desired effect in the company detail screen by specifying only the image height in the dict file:
$fieldspec['image'] = array('type' => 'string',
                            'size' => 255,
                            'subtype' => 'image',
//only specify height       //'imagewidth' => 45,
                            'imageheight' => 45,
                            'control' => 'filepicker',
                            'task_id' => 'auvac_organization(filepicker)');

(If you only specify one dimension, HTML will scale proportionally.)

This does not seem to affect the filepicker. In fact, the filepicker seems to completely ignore my screen structure file as well:
$structure['xsl_file'] = 'std.filepicker.list1.xsl';

$structure['tables']['main'] = 'file';

$structure['main']['columns'][] = array('width' => '40%');
$structure['main']['columns'][] = array('width' => '10%');

// identify the field names and their screen labels
$structure['main']['fields'][] = array('file' => 'File Name');
$structure['main']['fields'][] = array('image' => 'Image',
                                       'imagewidth' => 75,
                                       'imageheight' => 45
                                       );



In my filepicker screen, the images are all 60px squares.


What I think should be happening here is that the image dimensions should be read from the image itself and the scaling done accordingly per-image (the imagewidth and imageheight should specify the bounding box, not the absolute sizes).
I have attached a std.filepicker1.inc file where I have an unfinished attempt to do that.

What should I do to get proportional scaling in my filepicker? Is my std.filepicker1.inc edit worth pursuing?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Weird Parent->Child->Child screens help
Next Topic: override noedit on foreign field in multi2
Goto Forum:
  


Current Time: Sun Apr 28 15:27:06 EDT 2024

Total time taken to generate the page: 0.01116 seconds