I would like to be able to configure the dimensions (width/height) of the preview images (imagecache preset) in the browser.
As a suggestion I add a patch. What do you think, does this make sense?

The patch is missing an "imagecache_preset_flush" after changing the settings for width/height.
I tried to implement it in wysiwyg_imageupload_admin_settings_form_submit($form, &$form_state)

/*
 * Implementation of hook_form_submit
 */
function wysiwyg_imageupload_admin_settings_form_submit($form, &$form_state) {
  // If preview width/height changes, flush the imagecache preset
  if ($form_state['values']['wysiwyg_imageupload_browser_preview_width'] != variable_get('wysiwyg_imageupload_browser_preview_width', 200) 
    || $form_state['values']['wysiwyg_imageupload_browser_preview_height'] != variable_get('wysiwyg_imageupload_browser_preview_height', 200) ) {
    imagecache_preset_flush('wysiwyg_imageupload_browser');
    watchdog('info', 'Imagecache preset wysiwyg_imageupload_browser flushed after settings were changed.');
  }
}

For some reason it seems that this is not the correct hook.
Any suggestion where to do this right?

Comments

jbiechele’s picture

The patches and an additional .install

eugenmayer’s picture

Well just to sort things out, you want to modify the size of the images in the image browser. We have to options here:

1. using CSS: Well thats not the "cleanest" way to accoplish this, as images of a bigger size are loaded probably. Overall bad qualitiy
2 We can set the imagecache preset-type to use in the admin interface

Well iam all for approach 2

jbiechele’s picture

Yes ok I fully agree with your option 2.
with the additon to adjust the css and eliminate width/height properties in class .browser_image.

eugenmayer’s picture

Title: Imagebrowser - let define width / height of imagecache preset » Imagebrowser - use a preset + let admin choose the preset to use.
Priority: Normal » Minor
gausarts’s picture

subscribing. Thank

whatsnewsisyphus’s picture

subscribing

eugenmayer’s picture

Status: Active » Fixed

I have reimplemented it a bit, its now included in 6.2

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

eugenmayer’s picture

Status: Closed (fixed) » Fixed
eugenmayer’s picture

Status: Fixed » Closed (fixed)