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

0 Members and 1 Guest are viewing this topic.

Offline alphavto

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • http://www.block-a.de
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #330 on: May 19, 2008, 09:30:45 PM »
Bei mir ist das selbe Problem seit Version 1.7.6
Der Resizer funktioniert als Admin aber nicht als User, da kommt diese Meldung:

Fehler beim Upload der Bild-Datei:
Bild1.jpg: Die Bildbreite ist unzulässig

Offline shadowhunter

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Fotogalerie & Fotocommunity scluzern.com
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #331 on: May 25, 2008, 01:21:54 PM »
Hallo.

Da ich einen gemieteten Server besitze, habe ich nur einen eingeschränkten Speicher für das automatische Verkleinern der Bilder.

Ich benötige folgende Änderung für die Dateiendung *.jpg:
Kann man in diesem MOD zusätzlich eine maximale Breite und Höhe definieren, sodass dann die gleiche Meldung "Bild zu gross" kommt (wie im originalen Code von 4images).

Das müsste so funktionieren:
- Wenn ein Bild grösser als 2000 x 2000 Pixel ist, dann kommt die Fehlermeldung "Fehler beim Upload der Bild-Datei. Die Bildbreite ist unzulässig" bzw. "Die Bildhöhe ist unzulässig"
- Wenn ein Bild kleiner als 2000 x 2000 Pixel ist, dann soll dieser MOD das Bild ganz normal verkleinern auf die eingestellte Pixel-Grösse (nach: $this->auto_image['media'] = $config['auto_image']; ).

Aber ich möchte die "Maximale Dateigröße der Bilder in KB" nicht verkleinern, da wenn man Videos uploaden möchte, dann wäre dies eingeschränkt.
Ich brauchte eine kleine Modifikation an diesem MOD, sodass man die Pixel-Zahl begrenzen könnte (nicht die Dateigrösse).
Sozusagen eine Einstellung "Absolute maximale Höhe der Bilder in Pixel". (Einstellung kann von mir aus nur in der member.php gemacht werden; muss nicht im ACP verändert werden können.)

Wäre sehr nett. Vielen Dank im Voraus!
Gruss Jones


PS: 4images Version 1.7.6  php-Version: 5.2.5

Rembrandt

  • Guest
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #332 on: May 25, 2008, 06:28:30 PM »
Tag!
...Kann man in diesem MOD zusätzlich eine maximale Breite und Höhe definieren, sodass dann die gleiche Meldung "Bild zu gross" kommt (wie im originalen Code von 4images).
...
das kannst du doch eh im ACP unter allgemein einstellungen festgelegen, oder versteh ich da jetzt was falsch?

mfg Andi

Offline shadowhunter

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Fotogalerie & Fotocommunity scluzern.com
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #333 on: May 25, 2008, 06:55:03 PM »
Hallo Rembrandt!
Ja das ist mir schon klar. Wir verstehen uns nicht ganz bei dieser Sache.
Ich müsste eine zusätzliche Einstellung (zusätzlichen Code im MOD Auto image resize on upload) haben:
- Wenn ein Bild grösser als 2000 x 2000 Pixel ist, dann muss die Fehlermeldung "Fehler beim Upload der Bild-Datei. Die Bildbreite oder Bildhöhe ist unzulässig"
Konkret heisst das: Wenn ein Bild diese Grösse besitzt, darf dieser MOD nicht zu trage kommen -> Es muss dann diese Fehlermeldung kommen und das Bild darf nicht hinaufgeladen werden (Abbruch, wie wenn die eingestellte Dateigrösse überschritten wird).
Dieser MOD funktioniert bei mir einwandfrei, nur wenn aber ein Bild zu grosse Anzahl von Pixels hat, dann ist mein Server überfordert mit dem verkleinern des Bildes und der Server spuckt einen Fehler aus, weil die Kapazitätsgrenze erreicht worden ist.
Ich habe einen Webspace gemietet und kann somit die benötigten Änderungen in der Php Einstellungen nicht verändern bzw. erhöhen ("max_execution_time", "memory_limit")
Danke! Gruss Jones

Rembrandt

  • Guest
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #334 on: May 25, 2008, 07:06:43 PM »
achso...sry

hast du es schon mal mit einer eingenen php.ini versucht, solche probleme kenne ich von 1und1.

mfg Andi

Offline Warrior

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • Lawrence Family History
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #335 on: May 25, 2008, 11:01:51 PM »
Step 2.2
Find:
Code: [Select]
    if ($this->image_size[1] > $this->max_height[$this->image_type]) {
      $ok = 0;
      $this->set_error($this->lang['invalid_image_height']);
    }


Insert below:
Code: [Select]
      if ($this->auto_image[$this->image_type]) {
         $ok = 1;
      }
V@no, I am having problems with this. It's not the height thing, it's the width. I am using this, to include your other small mod that you posted a bit farther down in the thread. I am also using Chris' "Alternate directory for download files" mod. Everything works great... until a member goes to upload, and the width requirements give them an error. Near as I can tell looking at this mod of yours, the HEIGHT wouldn't be a problem, but the WIDTH is.

Offline Warrior

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • Lawrence Family History
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #336 on: May 25, 2008, 11:21:43 PM »
Disregard. I dunno what the problem was, but I have tested it repeatedly with a non-admin handle and it works like it's suppose to.

Offline shadowhunter

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Fotogalerie & Fotocommunity scluzern.com
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #337 on: May 27, 2008, 07:21:09 PM »
Hallo Zusammen!

@Rembrandt: Solche Sachen funktionieren bei meinem Server nicht. Fehler 500 erscheint...

Bei meinem Problem (Antwort #336) habe ich noch etwas herausgefunden (mögliche Lösung):

includes/upload.php
Ersetze durch folgenden Code:
Code: [Select]

        $this->abs_max_width['media'] = 2000;
$this->abs_max_height['media'] = 2000;
$this->abs_max_width['thumb'] = 2000;
$this->abs_max_height['thumb'] = 2000;
 }

 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;
    }
    // NEW
    if ($ok == 1 && $this->image_size[0] > $this->abs_max_width[$this->image_type]) {
      $ok = 0;
      $this->set_error($this->lang['invalid_image_width']);
    }elseif ($ok == 1 && $this->image_size[1] > $this->abs_max_height[$this->image_type]) {
      $ok = 0;
      $this->set_error($this->lang['invalid_image_height']);
    } // END NEW

    return $ok;
  }

Aber es funktioniert nicht mit diesem Code und ich weiss nicht warum.
Danke im Voraus. Gruss Jones

Offline rockboy_62

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #338 on: June 19, 2008, 08:44:41 PM »
this mod is very good.thanx.but i want when users dowload one of photos on gallery
photo downloaded in full size, not thumbnal!

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #339 on: June 19, 2008, 08:48:55 PM »
@rockboy_62

... then try this ... [TUT] One Image - Three sizes ...
... http://www.4homepages.de/forum/index.php?topic=20496.0
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline tucano

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #340 on: June 24, 2008, 10:33:25 AM »
thanks V@no, funktioniert wunderbar :-)
Benutze 1.76 und habe über das Tutorial One Image - Three Sizes hergefunden – (http://www.4homepages.de/forum/index.php?topic=20496.0) und habe dort die Punkte 1-3 befolgt.
Funktioniert bei mir auch beim Upload über den Admin-Bereich :-)

Offline OtusDesign

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #341 on: July 15, 2008, 05:08:46 PM »
Hi, I made all steps correctly and after upload "install_autoimage.php" to my server and press "start modify database" it says "An unexpected error occured. Please try again later. An unexpected error occured. Please try again later" I checked my database configuration its ok.
I'm waiting your helps
Thanks in advance

Offline LunaPark

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #342 on: July 18, 2008, 08:47:17 AM »
Hi.

Im thinking abou installing this mod.
Can anyone confirm, that it works on version 1.7.6 as well ??

And offcourse is it good ?
It does'nt appear to much on the quality of the photos ??

Hope to hear from on who allready has the mod installed.


Offline scotlenky

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #343 on: July 22, 2008, 04:57:18 PM »
Hello evreyone,

First things first: Thanks alot for this great mod and all the helpfull comments in this threat!

has anybody adapted the "copy to /big folder" part of step 1 to work with the resize function in the admin control panel?
I have been looking at the /admin/resizer.php file but am not sure where to insert bits from this http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313 modified step 1.

Any notches in the right direction would be very much apreciated,

Take care

Martin

Offline herb

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #344 on: August 15, 2008, 12:05:27 PM »
Hi Friends,

Some month ago i have installed this MOD to 1.7.3 - I found all was okey.

Now I am going to upgrade to 1.7.6.

Is there any experience, can You tell me whether I can use the old member.php, includes/upload.php, admin/settings.php and lang/>my language>/admin. php

Does that MOD works with 1.7.6 or is in the meantime an other solution available.

thx in advance
Greeting from
Herb
Germany