Postponed
Project:
ImageField
Version:
6.x-3.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Jan 2012 at 14:26 UTC
Updated:
13 Apr 2013 at 22:02 UTC
The preview of the default image in the widget settings is made thus:
if (!empty($widget['default_image'])) {
$form['default']['default_image_thumbnail'] = array(
'#type' => 'markup',
'#value' => theme('imagefield_image', $widget['default_image'], '', '', array('width' => '150'), FALSE),
);
}
Would one of these theme functions not be better suited to this?
// Use to generate a preview (admin view) of an imagefield item for use in
// field item forms and filefield widgets. Invoked by filefield_widget_process.
'imagefield_widget_preview' => array(
'arguments' => array('item' => NULL),
),
// Theme function for the field item elements. allows you to place children
// within the context of the parent.
'imagefield_widget_item' => array(
'arguments' => array('element' => NULL),
),
// Generates and img tag to the admin thumbnail of an ImageField upload.
'imagefield_admin_thumbnail' => array(
'arguments' => array('item' => NULL),
),
Comments
Comment #1
quicksketchI think
imagefield_admin_thumbnailwould be the most expected theme function, but it has the caveat that it creates a new file on your server. We would then have to clean up that file when the default image is deleted/replaced. We definitely could do that, but at this point in the D6 cycle we're probably not going to see a lot of changes to ImageField. Happy to look at patches.