Skip to content

Commit

Permalink
Minor improvements (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
belomaxorka committed Oct 2, 2023
1 parent c37badf commit 9c1b259
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
20 changes: 10 additions & 10 deletions library/attach_mod/includes/functions_thumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ function get_supported_image_types($type)

switch ($type)
{
case 1:
case IMAGETYPE_GIF:
$new_type = ($format & IMG_GIF) ? IMG_GIF : 0;
break;
case 2:
case 9:
case 10:
case 11:
case 12:
case IMAGETYPE_JPEG:
case IMAGETYPE_JPC:
case IMAGETYPE_JP2:
case IMAGETYPE_JPX:
case IMAGETYPE_JB2:
$new_type = ($format & IMG_JPG) ? IMG_JPG : 0;
break;
case 3:
case IMAGETYPE_PNG:
$new_type = ($format & IMG_PNG) ? IMG_PNG : 0;
break;
case 6:
case 15:
case IMAGETYPE_BMP:
case IMAGETYPE_WBMP:
$new_type = ($format & IMG_WBMP) ? IMG_WBMP : 0;
break;
}
Expand Down Expand Up @@ -186,4 +186,4 @@ function create_thumbnail($source, $new_file, $mimetype)
@chmod($new_file, 0664);

return true;
}
}
16 changes: 4 additions & 12 deletions library/includes/functions_upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,10 @@ class upload_common
var $ext_ids = array(); // array_flip($bb_cfg['file_id_ext'])
var $errors = array();
var $img_types = array(
// Не редактируйте!
1 => 'gif',
2 => 'jpg',
3 => 'png',
// 4 => 'swf', // [зарезервировано]
// 5 => 'psd', // [зарезервировано]
6 => 'bmp',
// 7 => 'tiff', // байтовый порядок intel [зарезервировано]
// 8 => 'tiff', // байтовый порядок motorola [зарезервировано]
// 9 => 'jpc', // [зарезервировано]
// 10 => 'jp2', // [зарезервировано]
// 11 => 'jpx', // [зарезервировано]
IMAGETYPE_GIF => 'gif',
IMAGETYPE_JPEG => 'jpg',
IMAGETYPE_PNG => 'png',
IMAGETYPE_BMP => 'bmp',
);

function init ($cfg = array(), $post_params = array(), $uploaded_only = true)
Expand Down

0 comments on commit 9c1b259

Please sign in to comment.