Mike Macgirvin wrote the following card Sat, 30 Sep 2017 07:30:01 +1000
Thumbnail Generation for Photos
Currently we generate all thumbnail images in PHP using the built-in library functions. This is becoming increasingly problematic as the higher pixel densities of modern cellphones is growing faster than typical PHP memory allocations on shared hosting or low-end VPS systems. This leads to a failure to generate a photo thumbnail and add to the photo library after upload.
There are a couple of possible solutions. The blueimp uploader we use for some photo uploads is able to provide scaling on the client before upload. This however would make it difficult to provide original size photos at all.
Another solution would be a system or plugin function which performed a first level image scale via shell commands in the filesystem using the Imagick 'convert' binary. This would require that package be available on the system and would likely be limited to Linux or Unix-like systems. Configuration and enabling of this feature would be done via the site admin pages. After resizing to this first level scale via a temporary file (probably 1600x1200 to be compatible with the 1024 max photo thumbnail size size as well as the highest quality cover photo scale), the thumbnails and any additional resolutions (including cropping) can easily be generated in memory. Then the temporary file can be removed.
Currently we generate all thumbnail images in PHP using the built-in library functions. This is becoming increasingly problematic as the higher pixel densities of modern cellphones is growing faster than typical PHP memory allocations on shared hosting or low-end VPS systems. This leads to a failure to generate a photo thumbnail and add to the photo library after upload.
There are a couple of possible solutions. The blueimp uploader we use for some photo uploads is able to provide scaling on the client before upload. This however would make it difficult to provide original size photos at all.
Another solution would be a system or plugin function which performed a first level image scale via shell commands in the filesystem using the Imagick 'convert' binary. This would require that package be available on the system and would likely be limited to Linux or Unix-like systems. Configuration and enabling of this feature would be done via the site admin pages. After resizing to this first level scale via a temporary file (probably 1600x1200 to be compatible with the 1024 max photo thumbnail size size as well as the highest quality cover photo scale), the thumbnails and any additional resolutions (including cropping) can easily be generated in memory. Then the temporary file can be removed.