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

0 Members and 1 Guest are viewing this topic.

Offline bentleykf

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #75 on: March 27, 2005, 07:02:17 PM »
sorry, my bad, just figured out that i should use the installer

too little sleep and too much coffee makes my brain turn to mush

Offline centopeia

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: I need a little help with this one
« Reply #76 on: April 02, 2005, 09:02:55 PM »
I wonder if some one can help me here.

I have this mod working perfectly on my local machine, but when I upload the files to my host, it simply does not work. That is, the user, can upload but when the upload finishes and we usualy see the image we've just uploaded, nothing happens, the upload form just stays there as if we where preparing to upload for the first time.

The image goes to the correct folder, but we cannot see it, and it does not apear in the DB.Its just like the script was uploading and stoping.

My host is NOT running PHP in safe mode, all other 4images sections work perfectly, including the thumbnails resize.

This is driving me crazy...I realy would like to have this going.

Tnks to any reply.

Regards
Martins

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #77 on: April 03, 2005, 05:53:31 PM »
Hi I have installed the MOD and I think that it works good cuz the size of the photo reduces but i am not sure where I have to set the the size of the image to be resize ... setings? but where

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 #78 on: April 03, 2005, 06:01:42 PM »
This MOD will resize uploaded by users images to Max. Image Width set in settings.

Step 8 (Added 19/09/04)
This is an optional step, u'd need it if u want resize images not only using max width value as dimention but also max height.
Install atleast Step 1.x from this fix:
[FIX] Max height has no affect when do image resize
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 ryann

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: [Mod] Auto image resize on upload.
« Reply #79 on: April 13, 2005, 08:50:08 AM »
my pics turn out really bad quality, am i the only one that this happens to ?

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.
« Reply #80 on: April 13, 2005, 02:38:37 PM »
no, that's why FAQ explains it ;) (it coveres thumbnails, but your case is the same)
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 zspider

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [Mod] Auto image resize on upload.
« Reply #81 on: April 14, 2005, 09:12:06 AM »
iv done the intergration with phpbb and this dont seem to wanna work for me :( i have the 4images installed on the same database as phpbb,

Offline zspider

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [Mod] Auto image resize on upload.
« Reply #82 on: April 14, 2005, 09:14:23 AM »
the images dont even shot they are 0kb :(

Offline herb

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #83 on: April 15, 2005, 03:57:07 AM »
I have a problem with Step 5
   
   
Quote
Step 5
Download "Autoimage Install" file.

Unzip it and upload to your 4images ROOT dir.
Start it http://yoursiteaddress/4images/install_autoimage.php



The download does not work.

I get this error message

Quote
DB Error: Could not connect to the database server (localhost, 4images).

From where can I get the "autoimage install" file?

Thx in advance

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 #84 on: April 15, 2005, 05:32:59 AM »
read my sig:
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 herb

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #85 on: April 16, 2005, 06:11:38 AM »
THX
my problem is now solved.
I found your working server :mrgreen:

Offline boatman9999

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [Mod] Auto image resize on upload.
« Reply #86 on: April 30, 2005, 12:42:47 PM »
I got error messages regarding filesize, width and height whenever I tried to upload as a user, rather than an administrator. The hint as to what might be wrong came from way back in the posts in that the function:  check_image_size() is only called when a user uploads.

The following changes within includes/upload.php have worked for me.

All this assumes that you have already changed the other files as described in:
http://www.4homepages.de/forum/index.php?topic=6800
and:
http://www.4homepages.de/forum/index.php?topic=7058

My suggested changes are:

Change the whole of the function check_image_size() with:

Code: [Select]
function check_image_size() {
 
  if ($this->auto_image[$this->image_type]) {
         $ok = 1;
         return $ok;
         }
   
    else {   
 
    $this->image_size = @getimagesize($this->upload_file);
   
    $ok = 1;
    if ($this->image_size[0] > $this->max_width[$this->image_type]) {
      $ok = 0;
      $this->set_error($this->lang['invalid_image_width']);
    }

    if ($this->image_size[1] > $this->max_height[$this->image_type]) {
      $ok = 0;
      $this->set_error($this->lang['invalid_image_height']);
    }
    }
     
    return $ok;
  }



Hope this helps!

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.
« Reply #87 on: April 30, 2005, 02:57:14 PM »
Change the whole of the function check_image_size() with:
Code: [Select]
function check_image_size() {
 
  if ($this->auto_image[$this->image_type]) {
 $ok = 1;
 return $ok;
 }
 
 else {
 
 $this->image_size = @getimagesize($this->upload_file);
 
 $ok = 1;
 if ($this->image_size[0] > $this->max_width[$this->image_type]) {
 $ok = 0;
 $this->set_error($this->lang['invalid_image_width']);
 }

 if ($this->image_size[1] > $this->max_height[$this->image_type]) {
 $ok = 0;
 $this->set_error($this->lang['invalid_image_height']);
 }
 }
 
 return $ok;
 }
U dont need this modifications, IF u did Step 2.2 correctly. The only way it wouldnt work for u if u inserted new block of code ABOVE the block of code u were supposed to find.


and also replace the whole of the function check_max_filesize() with:

Code: [Select]
function check_max_filesize() {
 
 if ($this->auto_image[$this->image_type]) {
 return true;
 }
 
 elseif ($this->HTTP_POST_FILES[$this->field_name]['size'] > $this->max_size[$this->image_type]) {
 return false;
 }
 
 else {
 return true;
 }
 }
With this mofication your max filesize that u set in the ACP will be ignored and your visitors will be able upload ANY size files. Do u want someone upload 800mb files? (obviously some server-side settings will affect it.)

P.S. dont u think using bbcode-formated post is better looking then using //////////////// ? ;)
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 boatman9999

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #88 on: May 03, 2005, 10:59:41 AM »
Thanks for your input.

1.  Height & width. Still can't make the first (ie part2.2) work in the suggested way. If new code is put below the existing code as suggested, then the script fails (appears to log an error via 'set_error($this->lang['invalid_image_height']);').

By putting amended code above the existing these errors are not logged and works fine. If I am doing something else wrong - don't now what it is. We will have to agree to disagree.

2. Filesize.  Quite right - silly me. I have now gone back to existing code for checking the file size. Thanks for tip.

3.  BBcode - have now changed post. Thanks again for tip.

Offline Tarzan

  • Pre-Newbie
  • Posts: 6
    • View Profile
    • www.Lustdschungel.de - DerFreizeitpark für Erwachsene...
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #89 on: May 09, 2005, 10:59:23 PM »
Hallo zusammen,

bekomme nach dem Einbau des Mod's eine Fehlermeldung sobald ich den upload-Button klicke.

Parse error: parse error, unexpected T_STRING in /mnt/kw2/08/926/00000017/htdocs/geschuetzt/pics/4Images/4images/member.php on line 606

Ich hoffe Ihr habt mir schnell ne Lösung. Bin absoluter Newbie was 4Images angeht und von PHP hab ich bisher allenfalls gehört...  :wink:

Ansonsten ultragenial!


Liebe Grüße

Tarzan