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

0 Members and 1 Guest are viewing this topic.

Offline webtrade

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #360 on: December 30, 2008, 04:42:28 AM »
Just when you thought there wouldn't be another one of those cries for help - "I've applied the mod but it's not working for regular users! Only admin!"

Hope someone can please assist. I've applied the mod a number of times in different installation directories (and studied the tutorial and read previous posts) but I stil have probs when users other than admin try and upload. Looking at previous posts it seems like step 2.2 is big culprit. This is an extract from my upload.php file:

function check_image_size() {
    $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']);
    }
   
    if ($this->auto_image[$this->image_type]) {
         $ok = 1;
      }
   
    return $ok;

Does it look OK? Any tips would be greatly appreciated!

Cheers

Offline webtrade

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #361 on: December 30, 2008, 04:53:06 AM »
Hi,

I should have mentioned that the error only occurs when regular users try to upload images larger than what I have specified (500px x 500px, 1mb). And that I have the settings activated in CPanel - Auto resize - yes; GD Bib.. selected) The message is:

Error uploading image file:
image.jpg: Image size invalid
image.jpg: Image width invalid
image.jpg: Image heigth invalid

Thanks!

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 #362 on: December 30, 2008, 07:37:03 AM »
This is probably one my first mods I made...
At the moment I don't have chance to check this myself, but try this:
remove changes in step 2.2

find:
Code: [Select]
    $this->image_size = @getimagesize($this->upload_file);Insert below:

Code: [Select]
      if ($this->auto_image[$this->image_type]) {
         return 1; //auto image is on, don't need check for anything else.
      }
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 webtrade

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #363 on: December 30, 2008, 09:49:40 AM »
Thanks for responding V@no. Much appreciated. I applied your suggestion but still have a prob, although the error message is now reduced to a one liner:

Error uploading image file:
image.jpg: Image size invalid

This scenario sounds familiar. I remember it from a previous post. I'll go back and have a read.

Cheers

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 #364 on: December 30, 2008, 03:35:45 PM »
That error is expected if you set "Max. image size in KB" in the settings to a too low number. Set it higher and that should fix it.
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 webtrade

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #365 on: December 31, 2008, 07:39:36 AM »
Thanks V@no! You're a legend! It works! I increased it to 2048kb and it's all good now.
Happy new year!  :D



Offline Blesi

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #366 on: January 07, 2009, 03:43:49 PM »
Ein paar Beiträge zuvor hat schon einmal jemand gefragt, ob es möglich ist, wenn ich ein Bild lösche, dass dieses zugehörige auch im BIG Ordner gelöscht wird. Leider bleibt bisher immer das Bild im BIG Ordner noch stehen. Mit der Zeit wenn mehrere Bilder kommen, wird das sicher sehr unübersichtlich. Kann jemand helfen?

Can anybody help? When i delete a picture, the original picture will not be deletet in the BIG folder.

Gruß Christian

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 #367 on: January 07, 2009, 04:13:50 PM »
It shouldn't happened...did you check if images in big folder are CHMOD 777?

[EDIT]
just checked on my local server and it deleted files in big folder as well.
« Last Edit: January 07, 2009, 04:34:22 PM by V@no »
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 Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #368 on: January 21, 2009, 02:44:40 PM »
Wow too big topic to search all pages, but I doubt that anyone else has done that.

What I would like....

If has user upload bigger image then maximum size (lets say max width/height: 1920x1020px), image is resized to those limits (1920x1020px) and it's uploaded to folder /big. Second resized image (based on 2nd limitation values: 900x900px) is being uploaded to original folder.

Has anyone already done that?

Offline meier

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #369 on: January 25, 2009, 01:00:47 PM »
Hallo, bei mir funktioniert der Mod nicht. Das Bild bleibt wie es ist. Bei Schritt2.2  hab ich auch diesen anderen code versucht.
Dazu scheint scheint das jetzt nicht mehr gleich angezeigt zu werden. Direkt upload ist eingestellt, aber ich muss erst auf Bild suchen gehen damit es angezeigt wird.

Offline Fere

  • Newbie
  • *
  • Posts: 19
  • echo "Hello world!"
    • View Profile
    • www.aribrushart.ro
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #370 on: January 27, 2009, 03:26:53 PM »
Used it on 1.7.6, aparently everything works fine for me.

Thanks for the mod!  :D

« Last Edit: January 27, 2009, 04:50:20 PM by Fere »

Offline jigar110

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: Need Help Plz
« Reply #371 on: February 03, 2009, 02:00:36 PM »
Hello and welcome to 4images forum.

You'll need [Mod] Auto image resize on upload


Hello Bro Vano Thanx For Ur Welcome And Reply

Vano I will Try This Mode U Suggest But Its Not Work For Me .
I Have Big Forum To And I Am Not newbii But I Dont Know Whats Happend With Me.

Error uploading thumbnail file:
jigar.jpg: Image width invalid
jigar.jpg: Image heigth invalid

And I Also Do It In Control Panel  (Auto-resize image  Yes)
I Have Godaddy Hosting and Vbulletin Forum

Vano Bro I Will Try 4image First Time And Some One Says U R Wasting Ur Time With 4images.
Go To Gallery Or Copermine Photo Gallery.

Vano Can U Solv My Pro I Will Doing New Fresh Setup And Give u FTP .

I Will Try Godaddy Autoinstaller 4Image Script But Also There Is To Same To Same Problem No Image Resize.

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 #372 on: February 03, 2009, 03:53:26 PM »
Double check step 2 and 2.2

Make sure you've inserted code below and not above.
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 yesme

  • Jr. Member
  • **
  • Posts: 61
  • Yes for 4images!
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #373 on: February 06, 2009, 05:46:31 AM »
Oh no. And no.

I have follow your Step 2 and 2.2 but the problem is seems like that. The uploaded image is NOT resize automatically. Please, why?

Info:
4images Version: 1.7.6
Linux Hosting
GD installed (Imagemagick, Netpbm are not installed)

Thank you.
Love 4images! @--^-----

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 #374 on: February 06, 2009, 06:39:30 AM »
can I see it?
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)