ionize/ionize — Issue #28: No thumbnails created for thumbnails larger than the image
Author: kojiroh
Created: 2012-02-11 18:28:28+00:00
State: open

When the thumbnails are about to be created, sizes that are larger than the image itself are skipped. Because of that, if a 500x500 image is uploaded, the parts where a 600 pixels wide image is required are left blank.
This is (intentionally?) caused by the following if condition on application/libraries/Medias.php, line 247 (as per version 0.9.7.7)

```javascript
if ($dim[$settings['master_dim']] >= $settings['size'])
{
...
}
```

Commenting out the if condition "fixes" the "problem", creating upscaled "thumbnails" of images.

While it makes sense that thumbnails, by definition, are the smaller versions of original images, some websites may contain many different sizes of images ranging from 100x57 to 1920x1080. For example, the editors of a news site might upload small sized images at first, and upload more detailed and bigger images later as more details about the news come in.

The CMS should compensate for these missing images. Here's my suggestions:

- A new option is added to the Administrator panel which allows the upscaling of images
- If the asked size for the thumbnail is larger than the image itself, the image is merely cloned
- When a thumbnail is requested via , and the CMS is about to return the filename, it first checks if the file actually exists, and if not, it returns the path to the original image