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?