• [Mod] Auto image resize on upload v2.0.1 (2010-12-18) 4 0 5 1
Currently:  

Author Topic: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)  (Read 589814 times)

0 Members and 1 Guest are viewing this topic.

Offline Mariuz

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #420 on: August 06, 2009, 11:07:32 PM »
Hey, du schreibst für bis zu 1.7.6..
also definitiv bei 1.7.7 nicht?

Lg
Marius

rinaldos

  • Guest
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #421 on: August 06, 2009, 11:10:18 PM »
Hi,
das was bei 1.7.6 funktioniert, funktioniert in der Regel auch bei 1.7.7 :-)

LG
Ingo

Offline Mariuz

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #422 on: August 06, 2009, 11:14:56 PM »
Okay dank dir ich werde es mal testen :)

Offline DarkM

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #423 on: August 13, 2009, 12:35:47 PM »
It works perfect also with version 1.7.7
(Funktioniert auch in der Version 1.7.7)

Offline kmcled

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #424 on: August 14, 2009, 02:05:44 AM »
Hi,

I tried to install this mod but it doesn't seem to work. I followed all the steps, but when I go to upload a large image, the page refreshes and no image is uploaded. I can upload an image smaller then my Max size settings, but nothing bigger. The admin Settings does have Auto-resize image enabled. Does anyone have a suggestion? My website is collegecircles.net

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #425 on: August 14, 2009, 03:07:47 AM »
Hello and welcome to 4images forum.

Most likely the problem is your server's restrictions, i.e. it set to deny any files bigger then XX size. You can check it ACP (Admin Control Panel) -> phpinfo() -> upload_max_filesize
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline kmcled

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #426 on: August 16, 2009, 10:23:01 PM »
Nevermind. I got it to work. I had to increase my servers max file upload size to greater size just like you said. All works fine now. Thanks!

Offline Blesi

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #427 on: August 28, 2009, 12:26:13 PM »
Hi I installed the Mods "3 Sizes" und "Annotaton". When I "check new images" after uploading via FTP then is a problem


Working on data/media/3/ksc_012.JPG file:
Error creating /3/ folder.
Error resizing image.
Error adding annotation in data/media/3/ksc_012.JPG file.
Error creating thumbnail.
Bild erfolgreich hinzugefügt: Training Karlsruher SC


Tanks for help
« Last Edit: August 28, 2009, 01:14:56 PM by Blesi »

Offline Blesi

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #428 on: August 29, 2009, 03:34:53 PM »
May it be a problems with the RIGHTS? "666" or "777"? Or what could it be? It installed the complete system already 4 or 5 times. Always the same problem :-(

After changing some rights, there is a "new" problem:

Working on data/media/3/ksc_018.JPG file:
Error copying original file into data/media/3/big/ folder.
Image resized.
Added annotation in data/media/3/ksc_018.JPG file.
Error creating thumbnail.
Bild erfolgreich hinzugefügt: Training Karlsruher SC

Offline Sebas Bonito

  • Sr. Member
  • ****
  • Posts: 271
  • Sebas Bonito
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #429 on: November 29, 2009, 06:19:28 PM »
I need an emergency help. 8O

My space is going over 2 gigabyte, cause of the original files.
I wanna keep this big-function, but to limit it. Many of my pictures
(uploaded by members) have a size of 3,4 sometimes 5 megabyte!
That's to much (all in all)... so:

1. how to decrease automatically also the (into the big-folder copied) image?
So far, during the uploading process, it only copies the original file.
I need something like: decrease to max 1680*1050, jpg-quality: 85

2. how to do this with existing pictures (without doing it manually for each one)?

Thanx
Sebas


I guess, it's somewhere here in the member.php?!
Code: [Select]
//--------------------------------------------
//--------- Auto Image Resizing --------------
//--------------------------------------------
                  if ($config['auto_image'] && !$uploaderror) {
                     $src_copy = MEDIA_PATH."/".$cat_id."/big";
                     if ($direct_upload) {
                        $src = MEDIA_PATH."/".$cat_id."/".$new_name;
                        $src_copy = MEDIA_PATH."/".$cat_id."/big";
                    }
                    else {
                        $src = MEDIA_TEMP_PATH."/".$new_name;
                    }
                    $do_resize = 0;
                if ($image_info = @getimagesize($src)) {
                       if ($image_info[2] == 1 || $image_info[2] == 2 || $image_info[2] == 3) {
                          $do_resize = 1;
                    }
                  }
                  if ($do_resize) {
                     if (!function_exists(init_convert_options)) {
                           require(ROOT_PATH.'includes/image_utils.php');
                        }
                        $convert_options = init_convert_options();
        if (!$convert_options['convert_error']) {
if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
$result = true;
  if (!@is_dir($src_copy)) {
    $oldumask = umask(0);
    $result = mkdir($src_copy);
    umask($oldumask);
    if (!@is_dir($src_copy) || !$result) {
      $result = mkdir($src_copy, 0755);

    }
  }
if ($result == true){
copy($src, $src_copy."/".$new_name);
}
                      $convert_options = init_convert_options();
                      if (!$convert_options['convert_error']) {
                        $quality = (intval($config['auto_image_quality']) && intval($config['auto_image_quality']) <= 100) ? intval($config['auto_image_quality']) : 100;
                        if (!resize_image($src, $quality, $config['max_image_width'], 1)) {
                          $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name;
                            $uploaderror = 1;
                         }
                     }
                   }else{
                    $do_resize = 0;
                   }
                      }
                     }
                  }
//-------------------------------------------
« Last Edit: November 29, 2009, 06:38:56 PM by Sebas Bonito »

Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #430 on: December 08, 2009, 05:25:25 AM »
Hi! Just wanted to ask - which is the latest version of the mod code with the changes inside, concerning saving of the original pics (hi-res) into the created /big/ directory ?  :roll:
Is this code entirely correct? For it differs in some way from the latest version published on the 1st page of this thread, and some snippets remind me of my old verson of this mod (which i used to implement several years ago)  :)


Offline Sebas Bonito

  • Sr. Member
  • ****
  • Posts: 271
  • Sebas Bonito
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #431 on: December 18, 2009, 07:55:48 PM »

Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #432 on: February 17, 2010, 01:58:02 AM »
I've solved the previous issue myself, but now I have another one, considering this MOD:

I have max_width 900 and max_height 1500 in my settings, and when uploading a big photo, it always resizes it to 900 px, whether its width or heights is the bigger one... So - I get pictures with 900х675 px (which is right) and 675x900 px, if in portait (vertical) mode (which is wrong, I should get 900x1200 instead (hitting the width limitation)).
Why does the script applies the maimum width parameter to the height of the pictures, if it is bigger than width?  :|

And may it be corrected?  :?


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #433 on: February 17, 2010, 06:35:00 AM »
Did you do Step 8?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #434 on: February 24, 2010, 11:54:41 AM »
Did you do Step 8?
Oops, I thought step 8 only concerns only the forced resize from admin-panel... now it works just OK, thanks  :)