hi
is it possible to set a max width for the picture?
or what can i do if i want pictures with maximal width
of 510 px?
thanks
regards
is it possible to set a max width for the picture?
or what can i do if i want pictures with maximal width
of 510 px?
thanks
regards
RE: possible to set a max width on image upload?
Thx.
RE: possible to set a max width on image uplo
That is, it is possible to resize the uploaded image to be the size you want but you can't change the size BEFORE it's uploaded.
The upload function (which obviously works on the server side, PHP, etc) uploads to the /tmp directory and the upload code then moves it to where it is required.
It is (should be?) a simple matter to modify that code to change the size. For example, I have modified .../editor/filemanager/upoad/php/upload.php to contain the code (I've no idea how the formattng of this will appear!)...
else
{
// move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;
$size = 400; // the maximum width
$mode = '0666';
$userfile_tmp = $oFile['tmp_name'];
$userfile_size = $oFile['size'];
$userfile_type = $oFile['type'];
$prod_img = $sFilePath;
$sizes = getimagesize($userfile_tmp);
$aspect_ratio = $sizes[1]/$sizes[0];
if ($sizes[0] <= $size)
{
$new_width = $sizes[0];
$new_height = $sizes[1];
}else{
$new_width = $size;
$new_height = abs($new_width * $aspect_ratio);
}
$destimg = ImageCreateTrueColor($new_width,$new_height) or die('Problem In Creating image');
$srcimg = ImageCreateFromJPEG($userfile_tmp) or die('Problem In opening Source Image');
ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die('Problem In resizing');
ImageJPEG($destimg,$prod_img) or die('Problem In saving');
imagedestroy($destimg);
unlink($userfile_tmp);
if ( is_file( $sFilePath ) )
{
BUT I do have the odd issue with this and am hoping for a reply to my question on this forum. It works fine using the test.html page supplied with FCKeditor but (for some reason as yet unknown) doesn't seem to go through the code when I use the Upload Image function. No doubt I've got something wrong but I can't see what (see my question 'Resizing Image in Upload').
RE: possible to set a max width on image uplo