# How to Configure the Admin Grid Thumbnail Size and Enable Image Click-to-Zoom in OpenMage Image Cleaner

> Learn how to configure OpenMage admin grid thumbnail size and enable image click to zoom for a better product image management experience. Easily adjust settings via System Configuration.

- Repository: [Fabrizio Balliano/openmage-image-cleaner](https://github.com/fballiano/openmage-image-cleaner)
- Tags: how-to-guide
- Published: 2026-03-01

---

**Set the configuration paths `admin/fb_image_cleaner/thumbnail_max_width` for pixel dimensions and `admin/fb_image_cleaner/enable_image_click` for zoom behavior via System → Configuration → Advanced → Image Cleaner, or override the defaults in [`app/code/community/Fballiano/ImageCleaner/etc/config.xml`](https://github.com/fballiano/openmage-image-cleaner/blob/main/app/code/community/Fballiano/ImageCleaner/etc/config.xml).**

The OpenMage Image Cleaner module renders image previews directly within the admin grid to streamline media management. Two configurable options control these previews: the **thumbnail maximum width** and the **click-to-zoom** feature that opens the original image in a new tab. This guide explains how to modify these settings through the admin interface or programmatically via XML configuration files.

## Configuration Architecture and Default Values

The module stores its settings using Magento’s standard configuration hierarchy. Default values are defined in [`config.xml`](https://github.com/fballiano/openmage-image-cleaner/blob/main/config.xml), while the admin interface fields are declared in [`system.xml`](https://github.com/fballiano/openmage-image-cleaner/blob/main/system.xml).

### system.xml Declaration

The admin configuration fields are defined in [`app/code/community/Fballiano/ImageCleaner/etc/system.xml`](https://github.com/fballiano/openmage-image-cleaner/blob/main/app/code/community/Fballiano/ImageCleaner/etc/system.xml). The thumbnail size field occupies lines 14–20, and the enable click-to-zoom field occupies lines 21–28. These declarations create the input fields under **System → Configuration → Advanced → Image Cleaner**.

### config.xml Defaults

Default values are stored in [`app/code/community/Fballiano/ImageCleaner/etc/config.xml`](https://github.com/fballiano/openmage-image-cleaner/blob/main/app/code/community/Fballiano/ImageCleaner/etc/config.xml). Line 55 sets the default thumbnail width to `200` pixels (`<thumbnail_max_width>200</thumbnail_max_width>`), while line 56 enables the zoom feature by default (`<enable_image_click>1</enable_image_click>`). These values apply when no custom configuration has been saved via the admin panel.

## Runtime Rendering Logic

The grid column renderer reads these configuration values at runtime to construct the HTML output. Located at [`app/code/community/Fballiano/ImageCleaner/Block/Adminhtml/Fbimagecleaner/Renderer/Image.php`](https://github.com/fballiano/openmage-image-cleaner/blob/main/app/code/community/Fballiano/ImageCleaner/Block/Adminhtml/Fbimagecleaner/Renderer/Image.php), the renderer executes the following logic:

```php
$max_width = Mage::getStoreConfig('admin/fb_image_cleaner/thumbnail_max_width');

// ... image tag construction with style="max-width:{$max_width}px" ...

if (Mage::getStoreConfig('admin/fb_image_cleaner/enable_image_click')) {
    $return = "<a href='{$url}{$row->getPath()}' target=_blank>$return</a>";
}

```

The renderer first retrieves the pixel limit via `Mage::getStoreConfig()` and applies it as an inline style. If the click-to-zoom setting evaluates to true (enabled), the thumbnail is wrapped in an anchor tag targeting the original image URL with `target="_blank"`.

## Admin Panel Configuration Steps

Configure the visual presentation of the grid without touching code by using the Magento backend interface.

### Adjusting the Thumbnail Size

1. Navigate to **System → Configuration → Advanced → Image Cleaner**.
2. Locate the **Thumbnail size** input field.
3. Enter the desired maximum width in pixels (e.g., `300`).
4. Click **Save Config**.
5. Clear the cache if required.

The admin grid will now render images with `style='max-width:300px'`, scaling down larger images while maintaining aspect ratio.

### Enabling or Disabling Click-to-Zoom

1. In the same **Image Cleaner** configuration section, find **Enable click on preview image to zoom it**.
2. Set the value to **Yes** (1) to enable the zoom link, or **No** (0) to display static thumbnails only.
3. Save the configuration.

When enabled, clicking any thumbnail opens the full-resolution image in a new browser tab; when disabled, the `<a>` wrapper is removed from the HTML output.

## Programmatic Configuration Overrides

Developers can enforce project-wide defaults without relying on admin users to save configuration values. Add the following XML to your theme’s [`local.xml`](https://github.com/fballiano/openmage-image-cleaner/blob/main/local.xml) or any module [`config.xml`](https://github.com/fballiano/openmage-image-cleaner/blob/main/config.xml) that loads after the Image Cleaner module:

```xml
<config>
    <default>
        <admin>
            <fb_image_cleaner>
                <thumbnail_max_width>250</thumbnail_max_width>
                <enable_image_click>0</enable_image_click>
            </fb_image_cleaner>
        </admin>
    </default>
</config>

```

This example sets a 250-pixel thumbnail width and disables the click-to-zoom feature globally. After clearing the configuration cache, the admin grid will reflect these values immediately, regardless of the settings visible in the admin interface.

## Summary

- **Thumbnail width** is controlled by the `admin/fb_image_cleaner/thumbnail_max_width` configuration path, defaulting to 200 pixels in [`config.xml`](https://github.com/fballiano/openmage-image-cleaner/blob/main/config.xml) (line 55).
- **Click-to-zoom** is controlled by `admin/fb_image_cleaner/enable_image_click`, defaulting to enabled (1) in [`config.xml`](https://github.com/fballiano/openmage-image-cleaner/blob/main/config.xml) (line 56).
- The rendering logic in [`Image.php`](https://github.com/fballiano/openmage-image-cleaner/blob/main/Image.php) applies these settings at runtime via `Mage::getStoreConfig()`.
- Changes can be made via the admin panel under **System → Configuration → Advanced → Image Cleaner** or overridden programmatically in XML configuration files.

## Frequently Asked Questions

### How do I change the default thumbnail size for all admin users?

Edit [`app/code/community/Fballiano/ImageCleaner/etc/config.xml`](https://github.com/fballiano/openmage-image-cleaner/blob/main/app/code/community/Fballiano/ImageCleaner/etc/config.xml) and modify the value inside the `<thumbnail_max_width>` tags on line 55, or create a [`local.xml`](https://github.com/fballiano/openmage-image-cleaner/blob/main/local.xml) file in your custom theme or module that overrides the `admin/fb_image_cleaner/thumbnail_max_width` path with your preferred pixel value.

### Why are my configuration changes not appearing in the admin grid?

Magento caches configuration data aggressively. After saving changes in the admin panel or modifying XML files, navigate to **System → Cache Management** and flush the **Configuration** cache. The [`Image.php`](https://github.com/fballiano/openmage-image-cleaner/blob/main/Image.php) renderer reads cached config values via `Mage::getStoreConfig()`, so stale cache will prevent updates from displaying.

### Can I disable the click-to-zoom feature while keeping thumbnails visible?

Yes. Navigate to **System → Configuration → Advanced → Image Cleaner**, set **Enable click on preview image to zoom it** to **No**, and save. This sets `admin/fb_image_cleaner/enable_image_click` to 0, causing the renderer to output the `<img>` tag without the surrounding anchor element, effectively disabling the zoom behavior while preserving the thumbnail preview.

### Is it possible to use different thumbnail sizes for different admin users?

The configuration paths follow Magento’s standard scope hierarchy (default, website, store). While the Image Cleaner settings are located under the `admin` scope node—which typically does not vary by frontend store view—you can implement different values per website or store by saving configuration values at those levels if your admin setup supports multi-store contexts, or by extending the renderer block to check for user-specific logic.