diff --git a/boot.php b/boot.php index 8b1f5a2e5a..6b79274d45 100644 --- a/boot.php +++ b/boot.php @@ -34,6 +34,24 @@ define ( 'JPEG_QUALITY', 100 ); */ define ( 'PNG_QUALITY', 8 ); +/** + * + * An alternate way of limiting picture upload sizes. Specify the maximum pixel + * length that pictures are allowed to be (for non-square pictures, it will apply + * to the longest side). Pictures longer than this length will be resized to be + * this length (on the longest side, the other side will be scaled appropriately). + * Modify this value using + * + * $a->config['system']['max_image_length'] = n; + * + * in .htconfig.php + * + * If you don't want to set a maximum length, set to -1. The default value is + * defined by 'MAX_IMAGE_LENGTH' below. + * + */ +define ( 'MAX_IMAGE_LENGTH', -1 ); + /** * Not yet used diff --git a/mod/photos.php b/mod/photos.php index ea4d7f81f5..624f0bdcaa 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -743,6 +743,12 @@ function photos_post(&$a) { $ph->orient($src); @unlink($src); + $max_length = get_config('system','max_image_length'); + if(! $max_length) + $max_length = MAX_IMAGE_LENGTH; + if($max_length > 0) + $ph->scaleImage($max_length); + $width = $ph->getWidth(); $height = $ph->getHeight(); diff --git a/view/theme/diabook/diabook-aerith/style.css b/view/theme/diabook/diabook-aerith/style.css index 6b772edf2f..630b331e93 100644 --- a/view/theme/diabook/diabook-aerith/style.css +++ b/view/theme/diabook/diabook-aerith/style.css @@ -2885,7 +2885,7 @@ section .directory-item dd { height: 175px; } -.directory-photo-wrapper { +section .directory-photo-wrapper { float: left; height: 200px; width: 165px; diff --git a/view/theme/diabook/diabook-blue/style.css b/view/theme/diabook/diabook-blue/style.css index b1de266082..952f907750 100644 --- a/view/theme/diabook/diabook-blue/style.css +++ b/view/theme/diabook/diabook-blue/style.css @@ -2843,7 +2843,7 @@ section .directory-item dd { height: 175px; } -.directory-photo-wrapper { +section .directory-photo-wrapper { float: left; height: 200px; width: 165px; diff --git a/view/theme/diabook/diabook-dark/style.css b/view/theme/diabook/diabook-dark/style.css index 844ed369e9..5ef9398ec5 100644 --- a/view/theme/diabook/diabook-dark/style.css +++ b/view/theme/diabook/diabook-dark/style.css @@ -2857,7 +2857,7 @@ section .directory-item dd { height: 175px; } -.directory-photo-wrapper { +section .directory-photo-wrapper { float: left; height: 200px; width: 165px; diff --git a/view/theme/diabook/diabook-green/style.css b/view/theme/diabook/diabook-green/style.css index 111c31cfef..e1993764e0 100644 --- a/view/theme/diabook/diabook-green/style.css +++ b/view/theme/diabook/diabook-green/style.css @@ -2872,7 +2872,7 @@ section .directory-item dd { height: 175px; } -.directory-photo-wrapper { +section .directory-photo-wrapper { float: left; height: 200px; width: 165px; diff --git a/view/theme/diabook/diabook-pink/style.css b/view/theme/diabook/diabook-pink/style.css index b0b768df21..e9bcd53d04 100644 --- a/view/theme/diabook/diabook-pink/style.css +++ b/view/theme/diabook/diabook-pink/style.css @@ -2872,7 +2872,7 @@ section .directory-item dd { height: 175px; } -.directory-photo-wrapper { +section .directory-photo-wrapper { float: left; height: 200px; width: 165px; diff --git a/view/theme/diabook/diabook-red/style.css b/view/theme/diabook/diabook-red/style.css index 16b42d0e10..72592168b5 100644 --- a/view/theme/diabook/diabook-red/style.css +++ b/view/theme/diabook/diabook-red/style.css @@ -2870,7 +2870,7 @@ section .directory-item dd { height: 175px; } -.directory-photo-wrapper { +section .directory-photo-wrapper { float: left; height: 200px; width: 165px; diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index 049fb7ba44..68bfd5d3a9 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -2808,7 +2808,7 @@ section .directory-item dd { width: 175px; height: 175px; } -.directory-photo-wrapper { +section .directory-photo-wrapper { float: left; height: 200px; width: 165px;