• [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 591515 times)

0 Members and 1 Guest are viewing this topic.

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 v2.0 (2010-12-12)
« Reply #465 on: December 18, 2010, 01:32:13 AM »
do you have this line in includes/upload.php?

    $this->auto_image['thumb'] = $config['auto_thumb'];

If you didn't install v2.0 from the beginning, make sure you follow these steps to update
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 haider512

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
« Reply #466 on: December 18, 2010, 10:32:18 AM »
do you have this line in includes/upload.php?

    $this->auto_image['thumb'] = $config['auto_thumb'];

If you didn't install v2.0 from the beginning, make sure you follow these steps to update

yes i guess i have installed v2.0..

and as far as i know..this code is in right place..

function Upload() {
    global 
$config$lang;

    
$this->max_width['thumb'] = $config['max_thumb_width'];
    
$this->max_width['media'] = $config['max_image_width'];
    
$this->max_height['thumb'] = $config['max_thumb_height'];
    
$this->max_height['media'] = $config['max_image_height'];
    
$this->auto_image['media'] = $config['auto_image'];
    
$this->auto_image['thumb'] = $config['auto_thumb'];
    
$this->max_width['avatar'] = $config['avatar_width'];
    
$this->max_height['avatar'] = $config['avatar_height'];

    
$this->max_size['thumb'] = $config['max_thumb_size'] * 1024;
    
$this->max_size['media'] = $config['max_media_size'] * 1024;
    
$this->max_size['avatar'] = 99999999999;

    
$this->upload_mode $config['upload_mode'];
    
$this->lang $lang;

    
$this->set_allowed_filetypes();


but still having the thumb auto resize problem problem??

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 v2.0.1 (2010-12-18)
« Reply #467 on: December 18, 2010, 07:12:47 PM »
My apologies, it was my misstake. I misspell the setting name in step 2, it's $config['auto_thumbnail'] not $config['auto_thumb']
just re-do Step 2
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 haider512

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
« Reply #468 on: December 18, 2010, 10:03:21 PM »
My apologies, it was my misstake. I misspell the setting name in step 2, it's $config['auto_thumbnail'] not $config['auto_thumb']
just re-do Step 2


No Problemo..Awesome Many THanks... great job bro...


its working like a charm now..

Many Many thanks..

Offline haider512

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
« Reply #469 on: February 23, 2011, 05:13:29 PM »
Hello sir im having little Problem..

when i try to upload image on my website it dont resize.. but when i try to upload image on wamp on local PC.. it resizes..

why it is not resizing on server.. what to do..really need support.. Please Please Please Help..

Offline Warrior

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • Lawrence Family History
Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
« Reply #470 on: May 05, 2011, 10:27:14 PM »
Problem... need Mod for this-

In the AdminCP, when using the Edit/Move to a different category OR using the Add Image functions, it is not moving (edit function)/uploading (Adding Images) the file to the BIG folder.

I have also manually moved the BIG file AFTER having moved a file (edit function) as well as ADDED the BIG file to the BIG folder for the correct category (Adding Images), BUT the DOWNLOAD link will not "read" the big file. EDIT: The problem is known but not solved. it was a case of CAPS vs lowercase in the file names.

Normal Member page upload into a category, everything works... as long as the image is NOT moved afterward to a different category! ...except one thing... It seems if the main upload file has caps in the file name, those are kept in the BIG file, but the RESIZED image is dropped to lower case. Is there  a fix for that?

So a MOD add-on to the current MOD this thread discusses would be greatly appreciated.

EDIT:

Solved the moving issue here: http://www.4homepages.de/forum/index.php?topic=6759.0

Looking at a previous post in this thread regarding Validation to see if anything there will assist. Validation already has the BIG validated at the same time. The CAPS/lower case thing happened here in the User upload, which is where I noticed that.

ANOTHER EDIT: Just thought of something... can ImageMagick change the case of letters when resizing the image? Nope. Not it. Saw when Validating the image, the file name WAS in caps, but after validation, the resized image went to lower case while the BIG file stayed upper case. Changed from ImageMagick back to GD. Did a direct Admin upload and the upper case remained. So it is within Validation that the case is changed.
« Last Edit: May 06, 2011, 09:18:41 AM by Warrior »

Offline mmarschner

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • Motoly
Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
« Reply #471 on: May 16, 2011, 03:48:42 PM »
Hello,

sorry for my english !!!  :cry:

if is possible, to run Auto image resize with multiupload http://www.4homepages.de/forum/index.php?topic=29519.0?

Thanks

Michael
Wozu brauchen wir Kernkraftwerke - fahrt doch lieber alle Rad.

MotOly - die Domäne für Motorradfahrer, die mit Olympus fotografieren.

Offline k12onos

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
« Reply #472 on: June 11, 2011, 06:58:01 AM »
does this mod work with v1.7.10 ?

or should I use 1.7.9 if I want to use this mod?

Offline clubbu

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: [Mod] Auto image resize on upload.
« Reply #473 on: July 22, 2011, 09:18:51 AM »
Quote from: stb
2) default display resized image, but make smthn. like button "hi res" to view an original

On my site I use [Mod] Show original image in new window by clicking on image.
And this mod automaticaly copy original file to /big/ folder if the image is being resized (/big/ folder also automaticaly created if its not exist).
Just need use in Step 1. this code:
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;
                  }
                       }
                     }
                  }
//-------------------------------------------

P.S. it works on my windows system, dont know about any others :roll:



Hello V@ano, I have used this Code for 1.7.10, there are problem?

Offline kimchu

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
« Reply #474 on: August 24, 2011, 04:24:28 PM »
Hello,

This MOD looks like already part of v1.7.10 - couldn't see difference from auto-thumbnailer and auto-image-resizer that came with v1.7.10. Is this correct ?

Can this MOD resize thumnails on images that are already uploaded in addition to while it is being uploaded ? I like to be able to give registered users the ability to resize thumbnails for categories that they have access to.

If this MOD can't do that, any suggestions as to another existing MOD ?

Thanks.

Kim

Offline stevie69

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
« Reply #475 on: March 05, 2012, 05:56:16 PM »
This worked perfectly with 4images 1.7.10 (I also have "MOD Annotation by SLL" v 1.4 installed). Thank you, thumbs up!

One issue, though... I also installed your BIG-modification: "[MOD] Auto copy original file to /big/ folder by resize on upload"

When an image is uploaded and saved in three versions (thumbnail, resized and original/big) and you later delete the file, then only the thumbnail and resized images are removed ... the original file in the /big folder is not deleted! Can you come zp with a small hack to delete the original file in the /big folder as well?


Best regards, Stevie.
« Last Edit: March 05, 2012, 06:16:44 PM by stevie69 »

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 v2.0.1 (2010-12-18)
« Reply #476 on: March 06, 2012, 03:16:05 AM »
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 stevie69

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
« Reply #477 on: March 06, 2012, 09:02:49 AM »
Hi V@no,

thanks for the kind welcome!

I checked the suggested MOD but I can't find anything in the features that sounds like a solution here - - this MOD doesn't seem to address the "bug" (original images remain in /big/ folder when a user decides to delete an image). Does it allow to find the "orphan" big files so an admin can batch delete them from time to time? Maybe I will try to come up with a small hack that does the /big/ delete immediately when the user deletes the other two file versions (thumb and resized).

I'm curious, how do you handle 4image updates when you finally have a dozen MODs included?

Best regards, Stevie.

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
« Reply #478 on: August 26, 2012, 10:18:48 PM »
V@no, Hello!

Is it possible to do same, via edit image? This MOD not work in "admin edit image" page. Photos which has been uploaded in the DB, before MOD installation, now in original size on details page. In case, reuploading via edit page, photo not resized and not saved in the "BIG" folder. Have i solution?

Many thx!

Offline kicks

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
« Reply #479 on: April 13, 2013, 03:12:07 AM »
Would someone help? I tried this, and it gives me a server error. ver is 1.7.11 -  I am thinking it does not work with this version.. thankyou!