// Old files may have 0 until migrated with scripts/upgrade.php
// For any legitimately unrepresentable ones, we could generate our
// own image (like a square with MIME type in text)
// Old files may have 0 until migrated with scripts/upgrade.php
// For any legitimately unrepresentable ones, we could generate our
// own image (like a square with MIME type in text)
// Doublecheck that parameters are sane and integers.
if ($width < 1 || $width > common_config('thumbnail', 'maxsize')
|| $height < 1 || $height > common_config('thumbnail', 'maxsize')) {
// Doublecheck that parameters are sane and integers.
if ($width < 1 || $width > common_config('thumbnail', 'maxsize')
|| $height < 1 || $height > common_config('thumbnail', 'maxsize')) {
- // Fail on bad width parameter.
- throw new ServerException('Bad thumbnail width or height parameter');
+ // Fail on bad width parameter. If this occurs, it's due to algorithm in ImageFile::getScalingValues
+ throw new ServerException('Bad thumbnail size parameters.');