The imce_scan_directory function ends up loading all the images in a directory in to memory to get the proper sizes. On folders with lots of images this can result in timeouts and blank screens.

Comments

paulsheldrake created an issue. See original summary.

paulsheldrake’s picture

StatusFileSize
new1.89 KB

The following is a patch for the latest release tag 7.11 that adds a new scan function "imce_scan_directory_standard_image_size". This function does not attempt to get accurate image sizes but uses a default for all images.

It creates a new config variable "imce_file_browser_default_image_size" which takes an array where you can change the default size to what you wish. Currently, it's set to 400x400. One thing to note however is that when the image preview loads that the image still maintains the correct proportions so it's nice that way. On images smaller than 400px in one dimension they do get upscaled which causes artifacts to show in the preview.

To use the new function you can update the settings.php file to have the following

$conf['imce_custom_scan'] = 'imce_scan_directory_standard_image_size';
thalles’s picture

Category: Bug report » Support request

Hi @paulsheldrake, something like this has been implemented and is in the dev branch.
Thanks for you patch!

thalles’s picture

thalles’s picture

Version: 7.x-1.11 » 7.x-1.x-dev
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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