4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on February 20, 2003, 03:23:29 AM

Title: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: V@no on February 20, 2003, 03:23:29 AM
This MOD will resize uploaded by users images and thumbnails to Max. Image Width set in settings.
Working on v1.7 - v1.7.9


-----------------------------------------------
Files to edit:
member.php
includes/upload.php
admin/settings.php
lang/<yourlanguage>/admin.php

-----------------------------------------------


Step 1
Open /member.php

Find:
Code: [Select]
   if (!$uploaderror) {
Insert above (if u installed "MOD Annotation by SLL" then, u'll need do Step 7 too):
Code: [Select]
//--------------------------------------------
//--------- Auto Image Resizing --------------
//--------------------------------------------
    if ($config['auto_image'] && !$uploaderror)
    {
      if ($direct_upload)
      {
        $src = MEDIA_PATH."/".$cat_id."/".$new_name;
      }
      else
      {
        $src = MEDIA_TEMP_PATH."/".$new_name;
      }
      $do_resize = 0;
      if ($image_info = @getimagesize($src))
      {
        if ($image_info[2] > 0 && $image_info[2] < 4 && $image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height'])
        {
          if (!function_exists("init_convert_options"))
          {
            require(ROOT_PATH.'includes/image_utils.php');
          }
          $convert_options = init_convert_options();
          if (!$convert_options['convert_error'])
          {
            $quality = intval($config['auto_image_quality']);
            $quality = ($quality >= 0 && $quality <= 100) ? $quality : 85;
            if (!resize_image($src, $quality, $config['max_image_width'], 1, $config['max_image_height']))
            {
              $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name;
              $uploaderror = 1;
            }
          }
        }
      }
    }
    if ($config['auto_thumbnail'] && !$uploaderror)
    {
      if ($direct_upload)
      {
        $src = THUMB_PATH."/".$cat_id."/".$new_name;
      }
      else
      {
        $src = THUMB_TEMP_PATH."/".$new_name;
      }
      $do_resize = 0;
      if ($image_info = @getimagesize($src))
      {
        if ($image_info[2] > 0 && $image_info[2] < 4 && $image_info[0] > $config['max_thumb_width'] || $image_info[1] > $config['max_thumb_height'])
        {
          if (!function_exists("init_convert_options"))
          {
            require(ROOT_PATH.'includes/image_utils.php');
          }
          $convert_options = init_convert_options();
          if (!$convert_options['convert_error'])
          {
            $quality = intval($config['auto_image_quality']);
            $quality = ($quality >= 0 && $quality <= 100) ? $quality : 85;
            if (!resize_image($src, $quality, $config['max_thumb_width'], 1, $config['max_thumb_height']))
            {
              $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name;
              $uploaderror = 1;
            }
          }
        }
      }
    }
//--- End Auto Image Resizing ----------------




Step 2
Open /includes/upload.php

Find:
Code: [Select]
   $this->max_height['media'] = $config['max_image_height'];
Insert below:
Code: [Select]
   $this->auto_image['media'] = $config['auto_image'];
    $this->auto_image['thumb'] = $config['auto_thumbnail'];



Step 2.2
Find:
Code: [Select]
   $this->image_size = @getimagesize($this->upload_file);
    $ok = 1;

Insert below:

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




Step 3
Open /admin/settings.php

Find:
Code: [Select]
 show_setting_row("upload_emails");
Insert below:
Code: [Select]
 show_setting_row("auto_image", "radio");
  show_setting_row("auto_image_quality");




Step 4
Open /lang/<yourlanguage>/admin.php

Find:
Code: [Select]
$setting['auto_thumbnail_quality'] = "Thumbnail quality<br /><span class=\"smalltext\">0 to 100</span>";
Insert below:
Code: [Select]
$setting['auto_image'] = "Auto-resize image";
$setting['auto_image_quality'] = "Auto-resize image quality";




Step 5
Download attached (#post_atach) file below.

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




Step 6
Go to Admin Control Panel -> settings. Under Upload settings u should find new options. Make sure "Max. image size in KB" is set to a high enough number




Step 7
This step u'll need only if u installed MOD Annotation by SLL
All u need to do is move code of Annotation, that u added in member.php, move it below the code u added in Step 1


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 (http://www.4homepages.de/forum/index.php?topic=7058.0)


Video tutorial for this mod:
http://www.asian-lady.org/tutors/resize-mod/resize-mod.html


Changes log

v2.0.1 (2010-12-18)
* Fixed: thumbnails not being resized by non-admins (re-do Step 2)

v2.0 (2010-12-12)
+ Added: thumbnails resize (more info and upgrade instructions here (http://www.4homepages.de/forum/index.php?topic=7700.msg154092#msg154092))

v1.0 (2004-??-??)
- First release

Title: Almost works
Post by: knuckles on February 20, 2003, 04:50:09 AM
/home/virtual/site56/fst/var/www/html/platinum/gallery/admin/settings.php on line 311

Line 311 is: show_setting_row("auto_image_quality");

But it looks fine, it must be cascading from somewhere else.
Title: Works
Post by: knuckles on February 20, 2003, 04:56:01 AM
Had to write the following two lines by hand:

show_setting_row("auto_image", "radio");
show_setting_row("auto_image_quality");

one of them had/has hidden chars that where affecting the script.

Thanks!
Title: Re: [MOD] Auto image resize on upload.
Post by: Chris on February 20, 2003, 06:38:28 AM
Quote from: V@no
This MOD will resize uploaded by users images to Max. Image Width set in settings.

Question:

I'm assuming this means it will scale down images that exceed the width/height setting and not scale up images that are smaller than the settings.  

Is this correct?
Title: [Mod] Auto image resize on upload.
Post by: V@no on February 20, 2003, 06:45:36 AM
yes, that's correct, the script checks first if image bigger then max width or height, then resize it if so.
Title: [Mod] Auto image resize on upload.
Post by: SLL on February 20, 2003, 09:09:32 AM
Very good idea, V@no! According to my experience, just 10% of users have some idea how to resize their images, so if they're trying to upload oversized photos, and gallery doesn't accept it, they just give up...
Title: [Mod] Auto image resize on upload.
Post by: IngoT on February 21, 2003, 12:58:48 AM
Hallo V@ano,

I have an error message. This error is not always. Mostly with large pictures.

Warning: imagecreatefromjpeg: './data/media/4/168-6875_IMG.JPG' is not a valid JPEG file in /homepages/8/d13361873/htdocs/digitalfotograf/bilderkiste/includes/image_utils.php on line 71


Warning: imagecreatefromjpeg: './data/media/4/168-6875_IMG.JPG.bak' is not a valid JPEG file in /homepages/8/d13361873/htdocs/digitalfotograf/bilderkiste/includes/image_utils.php on line 71


Here cut out of the lines 67 - 75:

else {
    $thumb = imagecreate($width, $height);
  }
  $image_create_handle = "imagecreatefrom".$types[$image_info[2]];
  if ($image = $image_create_handle($src)) {
    if (defined('CONVERT_IS_GD2') && CONVERT_IS_GD2 == 1) {
      imagecopyresampled($thumb, $image, 0, 0, 0, 0, $width, $height, ImageSX($image), ImageSY($image));
    }
    else {


Do you have a solution for the problem?

CU Ingo.
Title: [Mod] Auto image resize on upload.
Post by: Ernesto Taseffa on February 26, 2003, 04:37:57 PM
.
Title: [Mod] Auto image resize on upload.
Post by: tradertt on February 28, 2003, 06:22:18 PM
I am getting the same error too ... Although installed the mod but cannot work ... it seems that any thing that deals with converting of images .. there is a problem between windows and unix ...
Title: [Mod] Auto image resize on upload.
Post by: V@no on February 28, 2003, 10:25:43 PM
Quote from: tradertt
I am getting the same error too ... Although installed the mod but cannot work ... it seems that any thing that deals with converting of images .. there is a problem between windows and unix ...

can u do any image manipulations from admin control panel? if not, then ask your host what wrong, it's really nothing to do with the script itself.
Title: [Mod] Auto image resize on upload.
Post by: Ernesto Taseffa on February 28, 2003, 11:20:11 PM
.
Title: [Mod] Auto image resize on upload.
Post by: V@no on March 01, 2003, 01:04:15 AM
yes, that how this mod works...that was the simpliest way to do...:S

give me the alghoritm how to fix it, I'll fix the code ;)
Title: [Mod] Auto image resize on upload.
Post by: tradertt on March 01, 2003, 05:46:59 AM
Quote from: V@no
Quote from: tradertt
I am getting the same error too ... Although installed the mod but cannot work ... it seems that any thing that deals with converting of images .. there is a problem between windows and unix ...

can u do any image manipulations from admin control panel? if not, then ask your host what wrong, it's really nothing to do with the script itself.


Yes I can .. I can do the Auto Image Resize from my admin panel ... the one that is manually done .. but weird is cannot use your mod ...
Title: [Mod] Auto image resize on upload.
Post by: tradertt on March 01, 2003, 05:50:20 AM
Quote from: seffern
Hi V@no,

do you sleep also sometime?  :?:

I forgot to post today that I did not turned the "auto-resize-function" on in admin menu. I guess this was the reason for the error code above from 26.2.2003, since it disappeared...

So the current status is the one of this morning in the other thread. It resizes automatically the images, which exceed the max. restriction in the admin-menu.

But as far as I remember it just looks at the width restriction, not at the height restriction.

Dirk


Is there such a function to turn on in the admin menu? I cannto find the auto resize function ...
Title: [Mod] Auto image resize on upload.
Post by: V@no on March 01, 2003, 09:38:49 AM
Quote from: tradertt

Is there such a function to turn on in the admin menu? I cannto find the auto resize function ...

huh?
if u can not find that in the settings, then, no wonder it doesnt work.... :?
check again step-by-step instructions.
Title: [Mod] Auto image resize on upload.
Post by: tradertt on March 01, 2003, 01:13:03 PM
Sorry about that .. I saw the settings already .. goign to test it out now ...

 
  show_setting_row("auto_image", "radio");
  show_setting_row("auto_image_quality");


this had some problems and I tried pasting it into wordpad b4 pasting it back... all the lines of code were there only did not appear :D

Could I suggest that you compile all into a text file... maybe it will work better :D

Just a suggestion :D thank you for your help
Title: Skips admin, won't scale defined thumbnail
Post by: knuckles on March 01, 2003, 10:30:36 PM
V@no, I installed this hack minutes after you posted it and it worked right out of the box.  However, I was only testing it in one particular way.

Here's the problem:

1) If you use the Control Panel to upload, the images and thumbnails don't get scaled.  This could almost be a feature, but I'd rather it be an option.

2) If a member decides to upload a specific image as the thumbnail (rather than let the thumbnail get auto-generated) the images does NOT get scaled.  So I usually have a thumbnail the same size as the large image.

So far that's it.  Number 2 is the bigger headache since users have no choice but to define a thumbnail for movies and documents.  It would  be great if you can provide a hack for that.  Thanks man.  Great work BTW!
Title: Re: Skips admin, won't scale defined thumbnail
Post by: V@no on March 02, 2003, 06:13:15 AM
Quote from: tradertt

Could I suggest that you compile all into a text file... maybe it will work better

two things stops me from doing that way:
1) in .txt files can not be used colors :?
2) dont have a host to provide download from. :( can not afford my 300kbps upload stream for extra downloads  8O



Quote from: knuckles

1) If you use the Control Panel to upload, the images and thumbnails don't get scaled.  This could almost be a feature, but I'd rather it be an option.

I didnt plan integrate it into admin control panel, becase there is already half automated fetures - auto resize images/thumbnails.

Quote from: knuckles

2) If a member decides to upload a specific image as the thumbnail (rather than let the thumbnail get auto-generated) the images does NOT get scaled.  So I usually have a thumbnail the same size as the large image.

if u mean, that thumbnails do not get resized, then, its because I didnt do it for thumbnails.

Quote from: knuckles

Great work BTW!

Thank you! :oops:
Title: [Mod] Auto image resize on upload.
Post by: Lord Nite on March 03, 2003, 08:48:43 AM
Just installed this, and so far so good.

I am waiting for one of my members to upload an image before I give it a full thumbs up.  :D
Title: [Mod] Auto image resize on upload.
Post by: JackSilb on March 23, 2003, 12:28:48 PM
Hello,

I am trying to get the mod working for the last 2 hours.
I did the code mods, and started the <install_autoimage.php>
I can see the
<
 This script will modify your 4images database, so please
ALWAYS BACKUP YOUR DATABASE BEFORE RUNNING THIS MOD!

Please check out all fields shown below.
If they do not correspond to your settings, please
DO NOT START INSTALLER!
>

All the fields are correct expect I don't see the user for the database listed.

I am getting the followint error after I click start mod. database.

>
Not Found

The requested URL /4wdtrips/photogallery/< was not found on this server.
Apache/2.0.40 Server at _default_ Port 8085
>

Here is the URL on the top of the browser.
>
http://www.mydomain:8085/4wdtrips/photogallery/%3C?=$self_url?%3E
>

Can you help?

thank you.
-JACK
Title: [Mod] Auto image resize on upload.
Post by: V@no on March 23, 2003, 01:15:48 PM
ok, redownload the installer.
for some reason your host doesnt support using <?=$variable?> instead of <?php echo $variable; ?>
hope now it's gonna work.

Quote
All the fields are correct expect I don't see the user for the database listed.

no, it was not supposed to be showed, unless u want me to add username and password... :wink:
Title: Where to get the latest installer?
Post by: JackSilb on March 23, 2003, 08:12:07 PM
Hi V@no,

Where do I get the latest installer? Just to make sure I am getting the right one.

Thanks,
-JACK
Title: Re: Where to get the latest installer?
Post by: V@no on March 23, 2003, 08:16:23 PM
Quote from: JackSilb
Hi V@no,

Where do I get the latest installer? Just to make sure I am getting the right one.

Thanks,
-JACK

omg, there is only one installer.
use the link I posted in my installation guide.
Title: [Mod] Auto image resize on upload.
Post by: JackSilb on March 23, 2003, 08:30:38 PM
I am using the same but the file has the same date on it.  It is not a new installer.
I was assumign that you would change something on the file. Therefore, it would have a new date.

Is the Installer file new or not? I mean, has it changed since the one I tried?

Thank you!
-JACK
Title: [Mod] Auto image resize on upload.
Post by: V@no on March 23, 2003, 09:02:30 PM
yes, it's new file.
it was updated on 03/23/03 12:xxpm
if u still getting old file, then clear up your internet cache. :wink:
Title: Still can't auto resize
Post by: JackSilb on March 24, 2003, 12:11:46 AM
Yep, the install worked.

But
The script is not working. If I upload a file that is <= the max size it work just fine.

If it needs resizing, then it is comes back saying:
>

Request Entity Too Large
The requested resource
/4wdtrips/photogallery/member.php
does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.
Apache/2.0.40 Server at _default_ Port 8085

>

I have the file limit set for 1500K this file is just 650K

Do you think that this is the same deal as the install? I need to change the calls in the code or maybe something on the server?

What is next?
I apreciate your help.

-JACK
Title: regular users can't upload?
Post by: gooberlx on April 11, 2003, 04:40:03 AM
I'm having a problem with the normal users uploading. Admin can upload and autoresize works fine, but if a regular user tries then i get:

Code: [Select]
Error uploading image file:
IMG_0594.JPG: Image size invalid
IMG_0594.JPG: Image width invalid
IMG_0594.JPG: Image heigth invalid


file size is set to 300K
images size is 600x600

the admin user was able to upload this very image perfectly. And after upload the resized image conforms more than perfectly to my settings.

any suggestions?
Title: [Mod] Auto image resize on upload.
Post by: V@no on April 11, 2003, 05:43:56 AM
make sure u did correctly step 2.2. where the changes must be inserted before return $ok;
Title: still no go
Post by: gooberlx on April 11, 2003, 06:14:01 AM
Well, I rechecked the file and everything seems to be right.

Code: [Select]

    $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->max_size['thumb'] = $config['max_thumb_size'] * 1024;
    $this->max_size['media'] = $config['max_media_size'] * 1024;

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

    $this->set_allowed_filetypes();
  }

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;
}
Title: [Mod] Auto image resize on upload.
Post by: gooberlx on April 11, 2003, 09:29:24 AM
I've done a little debugging and made sure the code was going through the new loop. I'm assuming that the resizing should be done before check_image_size() is called?

check_image_size() is only called for non-ADMIN users, I see, and the picture turns out to be too big because it must not have been resized yet?

Any suggestions? I've double-checked all the files and could swear they're correct.

here's my resizing snippet, I don't see anything wrong.
Code: [Select]

//--------------------------------------------
//--------- Auto Image Resizing --------------
//--------------------------------------------
if ($config['auto_image'] && !$uploaderror) {
if ($direct_upload) {
$src = MEDIA_PATH."/".$cat_id."/".$new_name;
}
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');
}
if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
$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;
}
}
}
}
}
//-------------------------------------------
if (!$uploaderror) {
      $additional_field_sql = "";
      $additional_value_sql = "";


The problem occurs with both portrait and landscape pics (if that helps).
Title: [Mod] Auto image resize on upload.
Post by: gooberlx on April 11, 2003, 09:37:17 AM
I have found a hack around it by commenting out the errors added and forcing '1' for $ok where the code checks for image size, width and height.

It must not have been resizing the image before those checks.

Alas, I'm not very good with perl or php, so I'm kinda stumbling through this via trial and error.  :oops:
Title: [Mod] Auto image resize on upload.
Post by: V@no on April 11, 2003, 10:50:29 AM
but, if u do that, u wont have restrict on max thumbnail file size...

u know, now I look at those changes and think: " this is not the way it should be done..." :?
try change step 2.2. to this:
delete the changes u made in that step:
Code: [Select]
   if ($this->auto_image[$this->image_type] == 1) {
         $ok = 1;
      }

then, after
Code: [Select]
 function check_image_size() {
add this:
Code: [Select]
   if ($this->auto_image[$this->image_type] == 1) {
         return 1;
      }
Title: [Mod] Auto image resize on upload.
Post by: gooberlx on April 11, 2003, 12:18:07 PM
making some headway:

i get only this now:
Code: [Select]

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


with the max res at 600x600 and quality at 85 (ImageMagick), I find it hard to believe that this file is over 300K.  :?

Anyway, I'm gonna hit the sack.
Title: [Mod] Auto image resize on upload.
Post by: V@no on April 11, 2003, 01:41:50 PM
ah, ok, I see now.
this how that function should start:
Code: [Select]
 function check_image_size() {
    $this->image_size = @getimagesize($this->upload_file);
    if ($this->auto_image[$this->image_type] == 1) {
         return 1;
      }
Title: [Mod] Auto image resize on upload.
Post by: gooberlx on April 11, 2003, 10:49:42 PM
hmmmm, still the same problem. Here's how that whole section looks, and then where it's called: Somewhere $ok must be getting set to 0. But if that were true then certainly one of the other error messages should have be printed out.

Code: [Select]

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

Code: [Select]

if ($user_info['user_level'] != ADMIN) {
if (!$this->check_max_filesize()) {
$this->set_error($this->lang['invalid_file_size']);
$ok = 0;
}
if (eregi("image", $this->HTTP_POST_FILES[$this->field_name]['type'])) {
if (!$this->check_image_size()) {
$ok = 0;
}
}
}


So it seems the problem must be coming from check_max_filesize(), which would make sense since we're not resizing it until after that.

What I've done is copy that new "if" section and put it right after check_max_filesize().

Code: [Select]

  function check_max_filesize() {

if ($this->auto_image[$this->image_type] == 1) {
return 1;
}

    if ($this->HTTP_POST_FILES[$this->field_name]['size'] > $this->max_size[$this->image_type]) {
      return false;
    }
    else {
      return true;
    }
  }


But I still had to leave the new "if" statement in check_image_size(), otherwise I'd get invalid width and height again. So currently it works, and both check_image_size() and check_max_filesize() have that new "if" statement, but it still feels like a hack for some reason; like fixing a house with ducted-tape.
Title: [Mod] Auto image resize on upload.
Post by: V@no on April 11, 2003, 11:47:00 PM
no, u did right, that how it should be...just wondering how come it works for me... :?
anyway, also, I think in your last cade should be return true; instead of return 1;
Title: [Mod] Auto image resize on upload.
Post by: stb on April 19, 2003, 02:42:09 PM
privet, Vano

good hack, but as a idea (i did it on my gallery) to keep an original image too. a few concepts:
1) if needed resize -- resize
2) default display resized image, but make smthn. like button "hi res" to view an original
3) u'll need new /data/ dirs and some corrections to tables in the base

it'll be good to include such things in new versions of 4images, so as MPC
Title: [Mod] Auto image resize on upload.
Post by: V@no on April 19, 2003, 03:46:49 PM
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 (http://www.4homepages.de/forum/index.php?topic=3236.0).
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:
Title: [Mod] Auto image resize on upload.
Post by: Niko on April 24, 2003, 10:48:46 PM
V@no:

First: thanks for your nice addon! I like it very much!

I'm planning to use it together with this function (http://www.4homepages.de/forum/index.php?topic=1861). Perhaps it will work someday...  :D

But i have a question concerning your last posting here in this thread:
The files in the big-path can't be deleted via ftp. They have the "owner"-right of the user "wwwroot". So my ftp (which has the userid "XYZ") gets an "Permission denied" error.

Can you give me a hint how to set the "owner-right" properly?
Title: [Mod] Auto image resize on upload.
Post by: V@no on April 25, 2003, 12:01:26 AM
I'm not sure, since I never had deal with *NIX systems and CHMOD things...:?
but it seems for me, that this line set CHMOD to 755:
Code: [Select]
                                                       if (!@is_dir($src_copy) || !$result) {
                                                          $result = mkdir($src_copy, 0755);

                                                        }

I might be wrong though...
anyone else has a hint? ;)
Title: [Mod] Auto image resize on upload.
Post by: HelpMeNow on April 25, 2003, 12:56:13 AM
V@no,

I just wanted to thank you for this great mod. I LOVE IT!  :D

Thanks for your great work.
Title: [Mod] Auto image resize on upload.
Post by: andersen on May 10, 2003, 01:41:05 PM
This is very great mod. I had modify 5 minutes ago, my site didn't show any error.

but I had found one error is...

The original default setting for Auto-resize is "no" and
Auto-resize qualitu is empty.

when I had set to "yes" and with 100 for quality. press save changes.

but when after save changes back to setting again. the Auto-resize setting are back to default. system never saves my setting.

May I know which step I had miss?

Thanks
Title: [Mod] Auto image resize on upload.
Post by: andersen on May 10, 2003, 01:51:03 PM
please ignore my previous question...

My careless forget to run "install_autoimage.php"

now it save.

Thanks
Title: [Mod] Auto image resize on upload.
Post by: andersen on May 10, 2003, 02:08:03 PM
Dear all,

once again, new error for myself.

Everything work perfect, if user post over limit of pixels the server reject but will not auto-resize the over limit picture. System list error as below

"Error uploading image file: test_2.jpg"

Do this process related with ImageMagick?

Thanks
Title: will not resize images
Post by: sookes on May 14, 2003, 05:52:31 PM
I have spent 2 hours working on this.  I've redone it and checked to make sure I was using original files from the most recent version download.  The database is set up okay.

I've read through all the posts and have gained no illumination into what could go wrong.

The settings show up correctly in the control panel and can be manipulated there.

But no matter what I do, a user cannot upload a file over the specified max size.  It will not  resize the images.

I really like this and would like for it to work.

Any new ideas?
Title: [Mod] Auto image resize on upload.
Post by: V@no on May 14, 2003, 07:59:24 PM
do they get any errors, or the image just go through with the original size?
can u resize images from ACP?
Title: oops but still not always working
Post by: sookes on May 14, 2003, 09:30:14 PM
Caveat to all who come after - make sure the file you are trying to upload is not corrupted!  

I went back to test it all again and this time uploaded a different file.  It worked with an image that was only 400 pixels wide. I have the max size set to 300.

I then tried to upload another jpg from the same first group of large pictures 900 x 900 and it says this:

Marjorie.jpg: Image size invalid
Marjorie.jpg: Image width invalid
Marjorie.jpg: Image heigth invalid

I even took the image into Fireworks and reexported as a jpg to make sure the file was okay.

Is there any size restrictions in the program itself? Or could this be a server or time out problem?

The folks who will be doing the uploads aren't knowledgeable enough to reduce these scanned files and digital camera images.  Need to be able to deal with the larger files if possible.

Thanks for your help, my fellow Georgian!
Title: [Mod] Auto image resize on upload.
Post by: andersen on May 15, 2003, 08:37:43 AM
Quote from: sookes
I have spent 2 hours working on this.  I've redone it and checked to make sure I was using original files from the most recent version download.  The database is set up okay.

I've read through all the posts and have gained no illumination into what could go wrong.

The settings show up correctly in the control panel and can be manipulated there.

But no matter what I do, a user cannot upload a file over the specified max size.  It will not  resize the images.

I really like this and would like for it to work.

Any new ideas?


Ha!  :lol:

Your problem is my previous experience.

Please check your ImageMagick path, If you ImageMagick path is correctly problem will be solve.

P/s: Last time my mod on this, I waste a lot of time for setup and re-setup, everything is the ImageMagick path made the problem, try to use the most compatible ImageMagick path. Ask you host, and test all path on process.

Good Luck
Title: using gd with resizer
Post by: sookes on May 15, 2003, 02:38:53 PM
I wish for ImageMagick!  Doesn't come installed and I've looked at it and don't know that I can.  

Thanks anyway.
Title: Parse error
Post by: beachgerl on May 15, 2003, 10:10:18 PM
I copied everything in the mod and followed the instructions to the tee. Then I logged in as a registered user and attempted to upload. Here is what happened: I kept getting this parse error on member.php line 513. I can't find anything that is missing? Here's the code I did on member.php:

Code: [Select]

//---------------------------------
//-------- Auto Image Resizing-----
//---------------------------------

if ($config['auto_image'] && !$uploaderror) {
    if ($direct_upload) {
       $src = MEDIA_PATH. "/".$cat_id."/".$new_name;
  }
  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 (!fuction_exists(init_convert_options)) {
        require (ROOT_PATH.'includes/image_utils.php');
                }
        if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
        $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 != "") ? "" : "") ? "" : "")."<b>".$lang['file_upload_error'].": ".$new_name;
        $uploaderror = 1;
        }
        }
        }
        }
        }
//----------------------------------------


Other than that, the admin and install auto image settings seem to be fine. Or is it in other modified scripts?
Title: [Mod] Auto image resize on upload.
Post by: V@no on May 15, 2003, 11:18:44 PM
there is nothing wrong with this code.
what is on line 513?
Title: Line 513
Post by: beachgerl on May 15, 2003, 11:57:05 PM
I used Bbedit and the line 513 pointed at the new code I added from your code, starting with
Code: [Select]

if (!resize_image($src,... {
$msg.= (($msg !="")...


It came from the path .../member.php on line 513 parse error if I try to upload something. Is it this member.php or it comes from other scripts I modified?
Title: Changed the mod - one error
Post by: beachgerl on May 16, 2003, 09:31:57 AM
I deleted the original mod of member.php and used this code instead:
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;
                  }
                      }
                     }
                  }
//-------------------------------------------


Now, the only errors are:
gwenstefani.jpg: Image width invalid
gwenstefani.jpg: Image heigth invalid

The upload code is:
Code: [Select]

    $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']; <------

 function check_image_size() {
    $this->image_size = @getimagesize($this->upload_file);
if ($this->auto_image[$this->image_type] == 1) {
return 1;
}    
$ok = 1;

 function check_max_filesize() {
if ($this->auto_image[$this->image_type] == 1) {
return true;
}    

if ($this->HTTP_POST_FILES[$this->field_name]['size'] > $this->max_size[$this->image_type]) {
      return false;
    }
    else {
      return true;
    }
  }


I've run the install_autoimage.php and lang mod which are ok.

I've set the Image max. width and height to 600px and 1000k for size.

What am I doing wrong here? Does this mod also auto resize the larger image sizes, not just thumbnails?

Also, in admin settings I noticed that both Auto-Image-Resizer and Auto-Thumbnailer, when clicked on, say the message: "Select module to create thumbnail. Check module settings." What does that mean?  

Thanks again!
Title: Re: anyone who could solve this?
Post by: beachgerl on May 18, 2003, 03:01:52 AM
Anyone who could resolve this? Otherwise, I'd be forced to revert to original gallery scripts.

I'd appreciate it.

Thanks.
Title: Re: Changed the mod - one error
Post by: V@no on May 18, 2003, 06:33:44 PM
Quote from: beachgerl
What am I doing wrong here? Does this mod also auto resize the larger image sizes, not just thumbnails?
this mod doesnt have anything to do with thumbnails ;)

Quote from: beachgerl
Also, in admin settings I noticed that both Auto-Image-Resizer and Auto-Thumbnailer, when clicked on, say the message: "Select module to create thumbnail. Check module settings." What does that mean?

is your autothumnailer works at all?
"Select module to create thumbnail. Check module settings." means that u havent specifyed witch module do u want to use to create thumbnails or resize images (GD, ImageMagick or NetPBM)
Title: Re-coded the auto image upload
Post by: beachgerl on June 04, 2003, 09:02:30 PM
I'm back. Well, I still get parse error when I try to upload something as a regular user. I don't know why! Here's the code I re-typed in the member.php.

Code: [Select]
//--------------------------------------------
//--------- Auto Image Resizing --------------
//--------------------------------------------
if ($config['auto_image'] && !$uploaderror) {
if ($direct_upload) {
$src = MEDIA_PATH."/".$cat_id."/".$new_name;
}
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');
}
if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
$convert_options = ini_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;
}
}
}
}
}
//-------------------------------------------


The error message says:
"Parse error: parse error, expecting `']'' in /home/.../www/gallery/member.php on line 627"

What am I missing here? Can anyone see what's wrong with the code that I overlooked anything?

Thanks again for your assistance.
Title: [Mod] Auto image resize on upload.
Post by: Chris on June 04, 2003, 09:52:13 PM
What exactly is on lines 626, 627 and 628?
Title: I'm getting this error after installing this mod
Post by: sito99 on June 06, 2003, 08:48:41 PM
Warning: Cannot modify header information - headers already sent by (output started at /home/friends/lang/english/admin.php:540) in /home/friends/admin/admin_functions.php on line 172

Any ideas?

Thanks,
Title: Re: I'm getting this error after installing this mod
Post by: V@no on June 06, 2003, 09:21:35 PM
Quote from: sito99
Warning: Cannot modify header information - headers already sent by (output started at /home/friends/lang/english/admin.php:540) in /home/friends/admin/admin_functions.php on line 172

Any ideas?

yep, read FAQ ;)
Title: [Mod] Auto image resize on upload.
Post by: beachgerl on June 08, 2003, 07:57:21 PM
Quote from: Chris
What exactly is on lines 626, 627 and 628?

Code: [Select]

//--------------------------------------------  
 //--------- Auto Image Resizing --------------  
 //--------------------------------------------  
 if ($config['auto_image'] && !$uploaderror) {  
 if ($direct_upload) {
 $src = MEDIA_PATH."/".$cat_id."/".$new_name;
 }
 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');
 }
 if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
 $convert_options = ini_convert_options();
if (!$convert_options['convert_error']) {  
$quality = (intval($config['auto_image_quality']) &&<---------------- line 626
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;
 }
 }
 }
 }
 }  
 //-------------------------------------------



I'd appreciate any help on this. I wonder if the problem lies in this member.php or upload.php?

Thanks again.
Title: [Mod] Auto image resize on upload.
Post by: V@no on June 08, 2003, 08:08:02 PM
I dont know how did u break that line:
Code: [Select]
$quality = (intval($config['auto_image_quality']) &&<---------------- line 626
intval($config['auto_image_quality']) <= 100) ? intval($config[auto_image_quality']) : 100;
it must be this:
Code: [Select]
$quality = (intval($config['auto_image_quality']) && intval($config['auto_image_quality']) <= 100) ? intval($config[auto_image_quality']) : 100;
make sure u copy and paste this as ONE LINE!
Title: [Mod] Auto image resize on upload.
Post by: beachgerl on June 10, 2003, 08:28:45 AM
The editor automatically wraps the lines so I checked in text editor. Seems to be fine. I did find one error which was fixed but I STILL get the same parse error on line 627 mentioned above. I get that same error message when I try to click on "Edit Profile". Then I tried to log in as an admin, I tried to edit profile or upload an image, I get the same error! So that means the whole script is screwed up somewhere. Sigh. Do I need to do it all over again? It's driving me nuts trying to figure out what really went wrong! :)
Title: [Mod] Auto image resize on upload.
Post by: V@no on June 10, 2003, 12:31:21 PM
u missed single quote in this line:
Quote
$quality = (intval($config['auto_image_quality']) && intval($config['auto_image_quality']) <= 100) ? intval($config['auto_image_quality']) : 100;


P.S. never type by hands, do copy/paste
Title: [Mod] Auto image resize on upload.
Post by: beachgerl on June 10, 2003, 08:43:21 PM
Thanks!! It works now by fixing that single missed quote you mentioned.

Unfortunately, there's another error popping up after I tried to upload images. The error message said: "Fatal error:  Call to undefined function:  ini_convert_options() in /home/domain/www/gallery/member.php on line 624"

Code: [Select]

//--------------------------------------------
//--------- Auto Image Resizing --------------
//--------------------------------------------
if ($config['auto_image'] && !$uploaderror) {
if ($direct_upload) {
$src = MEDIA_PATH."/".$cat_id."/".$new_name;
}
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');
}
if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
$convert_options = ini_convert_options();<----------------------- line 624
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;
}
}
}
}
}
//-------------------------------------------


Sorry about this spew of errors. Thanks again for your assistance. :)
Title: [Mod] Auto image resize on upload.
Post by: V@no on June 10, 2003, 09:05:04 PM
As I mentioned before: "never type by hands"
U misspell again:
Quote
$convert_options = init_convert_options();
Title: [Mod] Auto image resize on upload.
Post by: beachgerl on June 10, 2003, 10:51:26 PM
Thank you again! It worked. So far no more code errors.

I'm a little confused about this script - isn't it supposed to resize the images upon upload? Do I need to change image's sizes before uploading as thumbnails?

Because the error I received is:

"Error uploading thumbnail file:
test1.jpg: Image size invalid
test1.jpg: Image width invalid
test1.jpg: Image heigth invalid"

I set image file sizes to:
Max. File Size: 1000 kb
Max. Image Width: 600 px
Max. Image Height: 600 px

Thumbnail file sizes to:
Max. File Size: 100 kb
Max. Image Width: 100 px
Max. Image Height: 100 px

I did another test with already resized thumbnail and regular image size. It worked. This script will not resize thumbnails? Or is there another script to do this like in another post? Sorry for the questions!

BG
Title: [Mod] Auto image resize on upload.
Post by: reson on June 11, 2003, 05:35:32 PM
i can't unpack "Autoimage Install"file.
Title: Does not work?
Post by: martinp on June 13, 2003, 03:12:47 PM
I installed the script and I see the extra fields but it does not work. I am either stupid or this script does not work on my server?! :?
I want to uplad a original image and need the script to make a thumbnail then convert the image and make a small one for the detail page, and then the original image should be placed somewhere so that when a user clicks download it will download the ORIGIANL image not the small converted one. Is this possible? If it si what am I doing  wrong????


thanks
Martin
Title: [Mod] Auto image resize on upload.
Post by: Vraxor on June 14, 2003, 11:26:46 AM
Hi V@no,

This mod sounds great, but I have a question.
When I look at your site images often have a size of 800x600 and then you allow me (and the other visitors) to click on the image for a full size view. Is this what this mod does or is that an extra addition.
Right now my site looks best if images have a size of 640x480, but I would like many wallpapers to be uploaded and so I need something that shows an image at 640 but still allows people to few full size in a new window.

Cheers,
Vraxor
Title: [Mod] Auto image resize on upload.
Post by: V@no on June 14, 2003, 10:37:04 PM
Quote from: Vraxor
When I look at your site images often have a size of 800x600 and then you allow me (and the other visitors) to click on the image for a full size view. Is this what this mod does or is that an extra addition.

What u see on my site is combination of this mod and "Show original image in new window by clicking on image".
to combine them u'll need this:
http://4homepages.de/forum/viewtopic.php?p=22313#22313
Title: [Mod] Auto image resize on upload.
Post by: Vraxor on June 15, 2003, 12:25:11 AM
wow, thanks a lot for the fast responce and I will soon try it out.

Cheers,
Vraxor
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: AntiNSA2 on March 16, 2005, 06:56:57 AM
Ive done my best to search through googles cache :) and I know that V@no is working on this , busy, or will work on this sooner or later :mrgreen:

But I woul like this mod to evolve to do this
Quote


 
   
   [REQ]Resize On upload into multiple sizes based on user level
« on: March 11, 2005, 04:25:37 PM »
      
I am having a hard time accessing google from China now...

But I have a modrequest that is from one of the lost mods...

I would like to have some things happen when a picture is uploaded.

If they belong to the basic user group then it is resized, and the original is discarded.i
If they belong to the normal user group, then it is resized and into 2 sizez, big and small and the original is discarded.
If they belong to lets say the power group, then it is resized into 2 sizes, and the original is stored in a folder named raw.

I want the exif/iptc information to be maintained throughout the process.
The big and raw folders need to be created automatically.

Then of course I need to have different permissions set to allow only special groups, say press, download the raw, and give them the option of which to download-
Original
Big
small

perhaps guest and registered could download big,,,,,

Thanks i Advance if you can help-

Robert
(ps hope this is short enough V@no)
And if at all possible I would like to have an optional standard annotation for all groups.

I was just trying to work on this before the great hack of 2005.

I know there is a way to maintain the info with image magic I think. But as it is near impossible for me to find any  other posts.... V@no you provided something very close to this on the original thread which is now gone

Unfortunately as I can no longer get access to the other pages of this orginal mod :(  I will post to the original here and hope and wish and perhaps even look for some small goats to sacrifice
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: marchchild on March 21, 2005, 11:53:10 AM
 :D Auto resizer works like a dream - thanks!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: bentleykf on March 27, 2005, 06:17:57 PM
Dont new rows need to be added to the MySQL table *_settings in order for the settings to be saved??

I did this and it works perfectly.  I added the rows;

auto_image
auto_image_quality

Correct me if i'm wrong please.

-bents
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on March 27, 2005, 06:56:22 PM
sorry, what is your question again?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: bentleykf 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
Title: Re: I need a little help with this one
Post by: centopeia 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: ascanio 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no 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 (http://www.4homepages.de/forum/index.php?topic=7058.0)
Title: Re: [Mod] Auto image resize on upload.
Post by: ryann on April 13, 2005, 08:50:08 AM
my pics turn out really bad quality, am i the only one that this happens to ?
Title: Re: [Mod] Auto image resize on upload.
Post by: V@no on April 13, 2005, 02:38:37 PM
no, that's why FAQ explains it ;) (it coveres thumbnails, but your case is the same)
Title: Re: [Mod] Auto image resize on upload.
Post by: zspider 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,
Title: Re: [Mod] Auto image resize on upload.
Post by: zspider on April 14, 2005, 09:14:23 AM
the images dont even shot they are 0kb :(
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: herb 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on April 15, 2005, 05:32:59 AM
read my sig:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: herb on April 16, 2005, 06:11:38 AM
THX
my problem is now solved.
I found your working server :mrgreen:
Title: Re: [Mod] Auto image resize on upload.
Post by: boatman9999 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!
Title: Re: [Mod] Auto image resize on upload.
Post by: V@no 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 //////////////// ? ;)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: boatman9999 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.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Tarzan 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
Title: T_STRING...
Post by: martrix on May 09, 2005, 11:25:39 PM
zeig doch mal 5 Zeilen vor und 5 Zeilen nach 606 in member.php

oder du kannst noch einmal Schritt für Schritt die Änderungen durchgehen, die V@no vorschreibt und nachsehen, ob du nicht irgend etwas vergessen hast...  :|
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Tarzan on May 10, 2005, 06:26:22 AM
hier mal die komplette Änderung der member php. Hoffe ja, dass die Fehlermeldungen bei den anderen geänderten dateien nicht witergehen...

Schonmal vielen Dank für eure Hilfe...


          if (create_thumbnail($src, $dest, $quality, $dimension, $resize_type)) {
            $new_thumb_name = $new_name;
          }
        }
      }
    }

//--------------------------------------------
//--------- Auto Image Resizing --------------
//--------------------------------------------
                  if ($config['auto_image'] && !$uploaderror) {
                     if ($direct_upload) {
                     $src = MEDIA_PATH."/".$cat_id."/".$new_name;
                  }
                  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');
              }
           if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
                $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, $config['max_image_height'])) {
                    $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name;
                          $uploaderror = 1;
                   }
                    }
                }
            }
//-------------------------------------------

    if (!$uploaderror) {
      $additional_field_sql = "";
      $additional_value_sql = "";
      if (!empty($additional_image_fields)) {
        $table = ($direct_upload) ? IMAGES_TABLE : IMAGES_TEMP_TABLE;
        $table_fields = $site_db->get_table_fields($table);




LG
Tarzan
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: martrix on May 10, 2005, 09:48:45 AM
tja, und wie erkenne ich Zeile 606? ;)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Tarzan on May 10, 2005, 10:59:34 AM
Hallo matrix,

dies ist im Skript die Zeile 606. :lol:

 if ($config['auto_image'] && !$uploaderror) {



Vielen Dank schonmal für Deine Mühe.

Ich hoffe Du kannst mir weiter helfen.

Gruß

Tarzan
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: martrix on May 10, 2005, 06:57:38 PM
Der von Dir gezeigte Code ist voll in Ordnung.

Das einzige, was ich dir raten kann, ist noch einmal Schritt für Schritt die Modifikation durchzugehen...

Bzw. Back-ups aufspielen und den Mod noch einmal zu versuchen...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: alphaed on July 14, 2005, 08:48:16 PM
Sorry for my question, but i can`t save setiings in my control panel (Auto-resize image and Auto-resize image quality). After submit (Auto-resize image = yes, Auto-resize image quality = 100) it became again Auto-resize image = no, Auto-resize image quality = .

Help me please.
Thanks
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on July 15, 2005, 12:02:20 AM
I'm sertain on 99% that you didnt do (properly) Step 5.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Marquis2000 on July 28, 2005, 01:55:48 PM
Also ich habe folgendes Problem, der Mod funktioniert sehr gut ausser das ich wenn ich ein kleineres Bild (kleiner als die im CP definierte Größe)hochladen möchte wird es automatisch auf die definierte Größe hoch scaliert!! Wie kann ich das verhindern, ist das ein Fehler in der Matrix lol ne im Code ???

Grüße Marquis
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: martrix on July 28, 2005, 06:21:52 PM
Sollte es eigentlich nicht machen - da der Code ja nachschaut, ob das Bild Grösser ist, als "max width" oder "max height" und erst dann runterskalliert...

Schau doch bitte noch einmal jeden Schrit an - ob du den Code auch richtig und an der richtigen Stelle hast  8)

Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Marquis2000 on July 29, 2005, 01:33:42 PM
Nee geht trotzdem nicht, dachte liegt daran das ich den MOD Annote Watermark installt habe und habe Schritt 7 im Code verändert aber geht trotz alle dem nicht ;(
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Marquis2000 on August 03, 2005, 06:33:21 PM
i have install the galerie fresh and this mod works but not if the image smaler then as in the ACP selected. If the Image smaler then auto-resize higher to the selected value in the ACP.  The Script checked generally if image smaler then specified value then not resize!!! Wats wrong?? sorry for my english  :oops:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on August 04, 2005, 12:58:13 AM
that is supposed to, because if you try to enlarge an image u'd end up with a ugly, pixelated, abstract picture.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: karimun on August 11, 2005, 11:13:00 AM
Hi all,
Does this MOD work for ({remote_media_file}) input field? In this case the image doesn´t get resized at my site.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on August 11, 2005, 02:00:24 PM
no, it doesnt
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: karimun on August 11, 2005, 05:22:29 PM
Means, that I have to permanently remove the {remote_media_file} input option, otherwise I nevertheless need to go on a regular basis through all the new posted images to resize them from the ACP.
Or, maybe .. somebody .. writes an additional hack?
Much appreciated.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Washi on August 17, 2005, 02:58:22 AM
V@no, another great mod. I just have a question that might be really stupid. LOL

Does this work if you upload files by FTP? Or just when you upload files from the control panel?

Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on August 17, 2005, 03:56:00 AM
This mod doesnt support ACP uploaded images and for FTP uploaded images use "Check and Go" or "Check new images in ALL categories" mods ;)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fireball22 on September 24, 2005, 10:56:22 AM
Ich habe mit dem Bild resizer ein Problem.
Bei mir sollte ja nur die Anzeige der Bilder verkleinert werden, so dass mein Layout davon nicht in Mitleit gezogen wird.
Die Bilder sollen bei einem klick auf diese dann in einem Pop-Up in voller größe erscheinen.

Wie macht man das?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on September 24, 2005, 11:03:21 AM
Ich würde es lieber in englisch versuchen... (o:

Und auch solltest Du hier nur Probleme mit dem Mod posten und nicht allgemeine Fragen.

Lies Dir mal ein paar Beiträge im Forum durch, hier gibt es viele die genau das was Du möchtest umgesetzt haben.

big image popup sollte deine suchbegriffe hierfür sein.

Schaue sonst auch noch mal hier vorbei:
http://www.4homepages.de/forum/index.php?topic=3236.0

Ich glaube eine fertige Lösung gibt es nicht wirklich und daher muss Du wohl die Mods kombinieren oder anpassen.
Title: Re: [Mod] Auto image resize on upload.
Post by: Fireball22 on October 01, 2005, 07:49:37 PM
Quote from: stb
2) default display resized image, but make smthn. like button "hi res" to view an original

On my site I use this (http://4homepages.de/forum/viewforum.php?f=15) MOD.
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:


In welche Datei muss ich diesen Code einbauen?

In which file i have to include this code?


Fireball22
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on October 01, 2005, 08:11:42 PM
watch the first Posting...

I think this is the Part for the member.php
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fireball22 on October 01, 2005, 08:24:32 PM
OK!

thanks!

Fireball22
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fireball22 on October 06, 2005, 05:41:39 PM
Hallo,
ich bekomme beim Uploaden nach der Installation von Auto-Image-Resize folgende Meldung:


Ich habe folgendes in der member.php statt das vorgesehene eingefügt:
http://www.4homepages.de/forum/index.php?topic=9847.msg47731#msg47731

Was ist das Problem?

English:

After the installtion of the Auto-Image-Resize I get this error-message:

Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /srv/www/htdocs/web1/html/extras/upload/includes/upload.php on line 96

Fatal error: Cannot instantiate non-existent class: upload in /srv/www/htdocs/web1/html/extras/upload/member.php on line 546

In the member.php I used this code:
http://www.4homepages.de/forum/index.php?topic=9847.msg47731#msg47731

Where is the problem?

Thank you for the answer!

Vielen Dank für die Antwort im Voraus!

Fireball22
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on October 07, 2005, 12:34:54 AM
made a misstake in Step 2.x
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fireball22 on October 07, 2005, 02:50:31 PM
OK, thank you!
I will check this.

Fireball22
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fireball22 on October 07, 2005, 03:08:31 PM
OK, the upload.php is now running correctly.

But now I have the follow problem:
When the pictures uploded, then nothing change, the size of the image is the same!

And where I can change the size of the auto. rezised image?

Thank you!

Fireball22

Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on October 07, 2005, 04:43:42 PM
Quote
Step 6
Go to Admin Control Panel -> settings. Under Upload settings u should find new options.

The Size for the Image you will allso find there... (o:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fireball22 on October 07, 2005, 05:40:07 PM
No, there isn't the option for the image-size.
Here a screenshot:
http://www.michael-kaps.s-westerhold.de/extras/upload/data/media/14/screen.jpg

But why don't run the image-resize on the screen? See my last post.

Fireball22
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on October 07, 2005, 07:13:42 PM
You must use the "Maximale Breite der Bilder in Pixel" and "Maximale Höhe der Bilder in Pixel" as Limit...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fireball22 on October 07, 2005, 07:34:49 PM
Thats only the size of the image, that users can upload!
But the image must be resize an than on click to the smal image, on the popup is the image in original size.

How can I do it?

Sorry for the bad English...  :roll:

Fireball22
Title: Re: [MOD] Auto image resize on upload.
Post by: Acidgod on October 07, 2005, 09:39:24 PM
This MOD will resize uploaded by users images to Max. Image Width set in settings.

Noch Fragen?
Bitte lies vorher auch ein paar Postings bevor Du fragst! Das hier ist der erste Satz in diesem Thema und selbst das hast Du nicht einmal gelesen??
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fireball22 on October 08, 2005, 10:00:38 AM
Wofür gibt es dann diesen Mod?
Die Einstellungen gibt es ja dann schon, das einzige was es dann noch an Einstellungen hinzugibt wäre das Begrenzen der Qualtität.
Und ich wurde hier hingewiesen, um folgendes machen zu können:
http://www.4homepages.de/forum/index.php?topic=9847.msg47731#msg47731

Fireball22
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on October 08, 2005, 11:14:20 AM
Mensch, das Limit gilt dann nicht mehr fürs uploaden. Das ist dann nur das Limit für die Detailansicht und uploaden kannst Du dann auch größere Bilder und diese werden dann verkleinert und das orginal in den BIG Ordner verschoben.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fireball22 on October 08, 2005, 11:58:42 AM
Och man, bin ich blöd  :?
Stimmt eigentlich!
Aber warum steht dann beim Upload von Images immer dran, dass die eingestelle maximal Upload-Größe z. B. immer noch 1280 Pixel statt unbegrent beträgt?

Fireball22
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on October 08, 2005, 12:05:08 PM
Na weil das Script das von alleine nicht entfernen wird und Du es selber machen müsstest.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fireball22 on October 08, 2005, 12:09:35 PM
Achso!
Könnte ich die Datei in der das mit dem Upload drin steht hernehmen und da das "include" für die Maximal größen gegen unbegrenzt ändern? Also einfach reinschreiben?
Und wo könnte man das mit dem PopUp ändern, weil da bei mir wieder die ganze Seite angezeigt wird, im Pop Up. Wie kann man das ändern, dass das Bild einzeln ein groß angezeigt wird, aber ohne Adressleiste?
Sonst funktioniert jetzt alles! Vielen Dank schon mal!
Achso und wie heißt die Datei wo das mit dem Upload drin steht?

Fireball22
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: marvick on October 12, 2005, 11:16:25 PM
Ich bekomme diese Meldung / after installing i get this:

Quote
Fatal error: Allowed memory size of 26214400 bytes exhausted (tried to allocate 3456 bytes) in /www/htdocs/w0057fa1/testfotoforum/4images/includes/image_utils.php on line 81
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on October 13, 2005, 07:40:51 AM
So und heute zeigen wir euch wie man ohne viel Grips die Suche missbraucht!!!

Als erstes sollten wir uns endscheiden wonach wir suchen wollen.

Also nehmen wir unsere Fehlermeldung und schauen was davon wohl brauchbar wäre:

Quote
Fatal error: Allowed memory size of 26214400 bytes exhausted (tried to allocate 3456 bytes) in /www/htdocs/w0057fa1/testfotoforum/4images/includes/image_utils.php on line 81

die Bytes und der Pfad sind von user zu user unterschiedlich, das leutet wohl jedem ein.

Also bleibt nur die wörter "Fatal error: Allowed memory size of exhausted tried to allocate" .

Wir endscheiden uns nur nach den Wörtern Fatal error: Allowed memory size zu suchen.

Ok was wir suchen wollen ist jetzt klar, nur um gotteswillen gebe ich nur die Suchbegriffe ein.... *grübel* *such*

Achja dort oben gibt es hinter dem Wort Suche: ein Textfeld, ich glaube damit sollte ich es mal versuchen...

Copy und Paste Fatal error: Allowed memory size ins Textfeld und dann mal fix auf suchen gedrückt.

Ich hoffe das ist die Lösung die die wolltest.

Achja das hat NULL was mit diesem Mod zu tun aber das nur so nebenbei...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fireball22 on November 01, 2005, 01:43:19 PM
Kann vielleicht der Admin die Änderungen für 4Images so hier hinschreiben, sodass auch die Bilder beim löschen im "Big"-Ordner gelöscht werden?
Weil bei mir die Bilder nach ca. 3 Montaten wieder alle gelöscht werden müssen und das eine rießige Sucherei bei erwarteten über 500 Bildern wird.

Wäre wirklich super, wenn man das noch ändern könnte!

Was nicht so wichtig ist, aber trotzdem total super wäre, wenn er auch die Änderungen hier posten könnte, dass man beim klick auf Download die original "big"-Datei downloaden könnte.

Fireball22
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on November 01, 2005, 05:14:38 PM
@ V@no and all,

I use this MOD since some times successfully on my website ...  :D
But now I need a change for it.

I also use successfully a Panorama-Media-Element for animated Panorama-Images on my site ...
... similar like these : http://www.4homepages.de/forum/index.php?topic=10250.msg50333#msg50333) .

The images for these Panorama-Media-Element are jpg-files (approx. 3500px x 300px) renamed as ram-files (for 360°-Panoramas).
But now by user-uploading via website these files are also resized, which of course should not be.

Now my questions :
How can I prevent resizing of these ram-files (and rm-files for 180°-Panoramas) ?

Can I use in /includes/upload.php the following code ... ? Where and how ... ?
Code: [Select]
if ($this->extension == 'ram , rm') {
    return 1;
  }

these code does not work for me ...
Code: [Select]
function check_image_size() {
    if ($this->extension == 'rm') {
    return 1;
    }
    $this->image_size = @getimagesize($this->upload_file);
    ....

thanks in advance
mawenzi
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on November 02, 2005, 12:34:05 AM
actualy its in member.php
find:
Code: [Select]
if ($image_info[2] == 1 || $image_info[2] == 2 || $image_info[2] == 3) { (from this mod ;))
replace it with:
Code: [Select]
if (($image_info[2] == 1 || $image_info[2] == 2 || $image_info[2] == 3) && !in_array(strtolower(substr(strrchr($new_name,"."), 1)), array("ram", "rm"))) {You can add into the array as many file extensions as you wish.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on November 02, 2005, 09:48:39 AM
thanks V@no for your fast assistance ...  :D

with a small correction it works perfectly !
Quote
... array("ram", "rm"))) {

mawenzi
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: troopers on November 11, 2005, 11:10:00 PM
hi,

does it give any solution for this mod,  to run with phpbb?  cause if i run this mod, nothing happend, and the thumbnails
are the download versions and the dl-version the thumbnails, -g-

my 'en' isnt very well :D

if i show my /orig folder, i didnt see any copy of the image... (yes, i editet the path :) )


v. 1.7.1
mod: multiupload, phpbb mod, check all cats, etc....
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on November 12, 2005, 12:16:10 AM
/me didn't understand neither what is the problem nor what is the question...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on November 12, 2005, 11:11:55 AM
try in german... (o:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: troopers on November 12, 2005, 10:34:52 PM
Hi,

mein problem momentan ist, das das ganze nicht wirklich so läuft wie es gern sollte :) finde irgendwie das problem von dem ding nicht wirklich, ok - hab auch lang nimmer was in php gemacht, aber meine experimentierfreude ist da -g-

hatte irgendwo gelesen, das das gleiche bei einem ist, mitm phpbb mod, das das nicht läuft... und bei mir das gleiche. die thumbnails sind die downloadbilder und umgekehrt. bilder werden nicht automatisch rezied und und und.... :)))

noaja, schaun ma mal :D ansonsten
 sind eure sachen super ...

gruß aus berlin
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on November 13, 2005, 11:08:53 AM
läuft den der Auto-Thumbnailer?

Oder bekommste grundsätzlich keine Thumbnails erstellt?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: chill on November 27, 2005, 06:03:33 PM
I'm having the same problem as some, I can set it to auto resize the image in my acp, and hit save but it doesn't save the setting.

I've d/led the install_autoimage.php, and installed it in the correct folder, but it still won't save the setting.

I saw someone stated that he forgot to run "install_autoimage.php"...stupid question, how do I run it if I have a remote server hosting my site?

I thought all I had to do was upload the modded phps and this new one via my ftp.

thanks
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: chill on December 07, 2005, 03:58:16 PM
I know that to you guys, this is stupid, but can someone please answer my question about what I need to do besides just uploading the new php file to my site via FTP?

Cause I've also had this problem of not saving settings when I tried to do the user template select mod.  And unless someone can answer this I guess that I'm not going to be able to do any mods where I need to add a new php file.

Thanks,
Bill
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on December 07, 2005, 06:18:14 PM
I saw someone stated that he forgot to run "install_autoimage.php"...stupid question, how do I run it if I have a remote server hosting my site?

... mmm ...  :roll: ...

... Installations instructions Step 5 ...
Unzip it and upload to your 4images ROOT directory ... (http://yoursiteaddress/4images/).
Start it http://yoursiteaddress/4images/install_autoimage.php
... that means ... type in this (of course your personal) address in your browser-adress-field -> than ENTER !
... now the installation is running ...

I hope this is answer is not too stupid ...  :wink:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: chill on December 09, 2005, 08:46:41 PM
thanks...now i can do some more mods :) :)

I knew it was something simple...but didn't think it would be that easy

thanks again
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Maniac on December 31, 2005, 04:50:13 PM
Perfect - exactly what I needed :)

Thanks!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: lemccoy on February 16, 2006, 03:23:11 PM
Would there be anyway for a user to select which size to create the files as?

Such as a drop down list:

Small - 640x480
Medium - 800x600
Large - 1024x768 (default)

sorry if this has been brought up I scanned through the pages but didn't see anything.

Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: artistichideaway on March 07, 2006, 10:56:59 AM
Works perfect. Thank you.  :D
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: |Rene| on March 07, 2006, 09:51:49 PM
Läuft super. Bei mir auch mit Mysql 5 :D

Danke
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: |Rene| on March 10, 2006, 02:44:25 PM
Habe festgestellt das auch bei mir nur der Admin den Mod nutzen kann. User bekommen weiterhin die Meldung Bild zu groß/breit/hoch.

Woran kann das liegen bzw. wie sähe der richtige code aus?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on March 10, 2006, 02:47:50 PM
Step 2.2 ?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: |Rene| on March 10, 2006, 02:57:16 PM
Step 2.2 ?

Seems to be correct. / Scheint richtig zu sein

    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;
  }


Habe den Threat hier auch schon durchgelesen, andere Änderungen hatten auch keinen Erfolg. Version ist 1.7.2 falls sich in dem Bezug auf 1.7.1 etwas geändert hat.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on March 10, 2006, 03:26:11 PM
Ok, replace
Code: [Select]
if ($this->image_size[1] > $this->max_height[$this->image_type]) {with:
Code: [Select]
if (!$this->auto_image[$this->image_type] && $this->image_size[1] > $this->max_height[$this->image_type]) {(and remove the changes from Step 2.2)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: |Rene| on March 10, 2006, 03:29:58 PM
Sorry but its the same. This is my function now:

Code: [Select]
  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->auto_image[$this->image_type] && $this->image_size[1] > $this->max_height[$this->image_type]) {
      $ok = 0;
      $this->set_error($this->lang['invalid_image_height']);
    }
    return $ok;
  }


Is the function only called when normal users are logged in? Because there's nothing about users in the function.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: |Rene| on March 18, 2006, 09:05:22 PM
Can anyone help here? I'm thinking the problem isn't solved yet.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: wallpapers on March 21, 2006, 07:00:10 AM
this is a great mod  :D
i don't install this mod before and it's works great with 1.7.2  :lol:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fastian on March 23, 2006, 06:05:20 PM
Hi
The mod works just fine but there are few things that I want to do. Let me ask one by one.

(1)I set Max width & height as 1024*768. I uploaded an image 1280*1024 and the result was 1024*819.
In setting I have Resize proportionally set to true. I also tried other two options but th result is different.
So the question is how can I make it exactly “1024*768”

//Edited
Found a Stupid mistake of mine. Removing this part
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fastian on March 25, 2006, 05:02:58 AM
V@no

If you could just give few minutes here. I believe this is not going to be too difficult.  :)

For standard wallpaper sizes, it may not cause that much problem but if someone upload an image say 1600*1000
The result is really very bad. 


Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fastian on March 27, 2006, 03:24:29 PM
Hi again

Sorry if I am acting like a child but I can’t stop myself.

I am building a wallpaper based site. The whole layout of the site is disturbing with different size of wallpapers. (Different dimensions)
People have started uploading and I m getting images in all dimensions..
Today I got few images in 1024*1000 & their thumbnails 133*130.
But I want to have only Full size as 1024*768 & thumbnails as 133*100.
Currently auto resize function is resizing with fixed width & proportional height. All I want to do is make it Fix Width & Fix Height.

Please suggest me something.

At least tell me if it’s not possible. I am not getting any reply and that’s disturbing too.    :cry:

Help me Please.  :(
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on March 27, 2006, 03:52:58 PM
What you are asking will not resize images proportionaly, and the result will be ugly...try change height of an image and you'll see what I mean.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fastian on March 27, 2006, 05:41:42 PM
What you are asking will not resize images proportionaly, and the result will be ugly...try change height of an image and you'll see what I mean.

You mean resizing with Fixed Width & Fixed Height will make images ugly??
That is quite possible but in only one case. Where image will have height greater than width.

But in my case almost everyone will upload standard wallpaper which always has width greater that height.

I try uploading a wallpaper of 1280*1024 (a standard size) & the result was 1024*915 & thumbnail 133*111

Currently, with every new upload, I have to do this:
• Download that wallpaper
• Resize it
• Upload
• Delete thumbnail
• & then create thumbnail.

So if making Width & Height Fixed have a slight effect on image quality I would go for this than to do all these steps.  :|

Or You can suggest me a better way.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: IcEcReaM on March 27, 2006, 05:58:49 PM
the better way would be  only to fix one value,
e.g. width, so the size will be calculated automaticcly,
and the ratio of the image will not be changed.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fastian on March 27, 2006, 08:24:54 PM
the better way would be  only to fix one value,
e.g. width, so the size will be calculated automaticcly,
and the ratio of the image will not be changed.

I can’t understand U.
Isn’t This the only way currently available??? Fix either height or Width.

But my problem is, I want to fix Both. And I explained the reason above.
Wallpapers have Standard resolutions.
(1024*1000) is not a good wallpaper as (1024*768)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: IcEcReaM on March 27, 2006, 10:48:09 PM
there is no way and will be no way,
if you resize an image with fixed width & height without losing the apsect ratio from the origin.
only solution for problems like that is to add borders to keep the correct aspect ratio.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on March 28, 2006, 01:51:47 AM
Alright, you want proof why fixed width and height can distort images with non-standart dimentions?
here:
The first attachment is original image (946x268) with non-standart dimention ratio.
And the second attachment is resized image to (800x600) which is 4:3 dimention ratio (1024x768 or 1280x1024 are also 4:3 ratio).
Now see what happend?
Even if "most" of the images you receive are with "standart" ratio, there still will be some with non-standart, and by resizing this way you will destroy them..
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fastian on March 28, 2006, 10:27:29 PM
Alright, you want proof why fixed width and height can distort images with non-standart dimentions?
here:
The first attachment is original image (946x268) with non-standart dimention ratio.
And the second attachment is resized image to (800x600) which is 4:3 dimention ratio (1024x768 or 1280x1024 are also 4:3 ratio).
Now see what happend?
Even if "most" of the images you receive are with "standart" ratio, there still will be some with non-standart, and by resizing this way you will destroy them..

Yes
You are absolutely right. This is a possibility.
This will surely happen and when width & height will have a bigger difference, the result will be horrible.

Perhaps I forgot to mention, Users can’t upload anything below 1024*768. (using  your Mod  Here (http://www.4homepages.de/forum/index.php?topic=7325.0))

Now if u just try to resize any 1280*1024 image with fixed width keeping aspect ration it will resize to 1024*819. (Using any image editor)
If u make it 1024*768 (Fixed) the result will not have any difference. (or at least minimum)

Most of the time I experience these kind of difference in dimensions. Till now I haven’t seen any unusual thing.

Actual Image
http://img70.imageshack.us/img70/9977/actual10242pq.jpg
Keeping Aspect Ratio (Fixed Width)
http://img141.imageshack.us/img141/3686/aspectratio6vj.jpg
Fixed Width & height
http://img66.imageshack.us/img66/9683/fixed9mh.jpg

But I DO understand your point. That’s why I m droping my request.

Is there any way I can check that which Image is bigger than 1024*768 (after being uploaded) ??
(For few user I don’t require to approve )
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: curtmo on April 11, 2006, 08:28:07 PM
I've got everything except:

Step 5
Download "Autoimage Install" file.

The link posted there times out and I can't seem to get the file.  Is it posted elsewhere?  Thanks for your help.

-Curt
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: ctforums on April 18, 2006, 07:30:07 PM
great mod, been using it for some time now  :wink:

just wondered, is there any way that I can get it to compress the image even if it is less than the maximum width?  Most images that are uploaded are at least 800x600, so I have my maximum width set to 799 pixels.  However, images that are say 600x480 are uploaded without being recompressed because they are not over 799 pixels wide.

Thanks for any help.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: IWS_steffen on April 22, 2006, 05:39:38 PM
Hi V@no

cooler MOD Danke

läuft perfekt.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: EmmaLee on May 13, 2006, 10:51:41 AM
Got a problem with this MOD or better said, it works PERFECT until I have added MOD AVATARS.

Before AVATARS, the Autoresize script has resized images by width. Since Avatars is installed the AutoResize tool is resizing my images by height.

I do not know what is wrong. I removed everything from Avatars also the database entries but the AutoResize won't work like before.

Only if the image is something like an wallpaper it resizes it with the max. width I have given in. all other images which are not landscape will be resized so that the new heigth of the images is the max. width I have given in.

Example:

I have given in max. width 720 and max heigth 1024

I upload an image with 900x1300  -> the result is an image with  XXX x 720   and not  720 x XXX   like it were before. If i upload 1280x1024 it will become 720x XXX ... This is arguing me and I have tried to find the mistake last night but there weren't anything.


I have 4image v1.7.1 and I have installed Private Message v2 MOD , the Autoresize MOD and the Avatars MOD with user uploading.


Can you help me...? The site is running by me and my boyfriend. www.world-of-rubber.net/gallery


Thanks!!!
Emma
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: ascanio on May 18, 2006, 08:01:14 PM
hi i have installed this mod and its working really good but i wonder if could use it too for the admin panel
for example when a user upload an image it resize to 330 px of width but i the admin wants to edit that image and upload another one it doesn't resize
so can i use this mod too fo the control panel when i edit an image from the main site?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on May 19, 2006, 12:54:57 AM
in ACP you have "auto resizer" feature, no point to create something else ;)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: dvorreiter on May 22, 2006, 09:06:34 AM
These resizing patches work fine only if the size of the original image file to be uploaded is <= 2Mbytes. If the size of the file is greater than 2Mbytes then when you press "Submit" it simply returns you to the same upload screen - requesting you to select the image file.. I have changed my max file size to a very large number (10000 KB) and even (10000000) kb iin the control panel but it doesn't seem to make any difference.

Is there a reason for this???

cheers
David
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on May 22, 2006, 09:38:14 AM
Server restrictions, contact your host administrator
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: dvorreiter on May 23, 2006, 02:48:40 AM
I am testing this locallly on a windows machine running apache 1.2. What server restrictions are you talking about? I can see nothing on the config file of apache that can configure this. Is it a restriction of mysql even though the files aren't loaded into the actual database?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on May 23, 2006, 02:52:03 AM
the php settings:
http://php.net/manual/ini.php
search for upload
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Guruberlin on May 27, 2006, 12:00:50 AM
Hello, in which 4images file I can change the PHP setings for uploading larger images ?

greetings from berlin :P
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on May 27, 2006, 07:49:08 PM
php.ini
if you dont have root access to the server, its doubtfull you'll be able to change it.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Child on May 31, 2006, 06:28:08 PM
Hello, my english is not very good- i try it in german

Wenn ich als Admin ein Bild hochlade funktioniert der Mod einwandfrei - verkleinert das Bild und macht ein Thumbnail. Wenn ich aber als normaler registrierter Benutzer ein Bild hochlade gibt er die Meldungen das das Bild zu groß für den Upload wäre (Begrenzungen) und verweigert den Upload.
Wo kann der Fehler liegen?

Habe ansonsten keine weiteren Mods installiert.

MfG
Lars
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: ahbut on June 20, 2006, 07:18:27 AM
Hello, I have install the whole script and had double checked 3 times for correct coding copy and paste to files and downloaded and place the 'install_autoimage.php' to the correct folder.

 First step I encounter a problem .. on the admin setting page, I checked auto reply image from default 'no' to 'yes', then click save setting, so it reload itself or even if i press settings again, the radio button to be back to default 'no' again, and the whole script won't work. Any solution to this please??
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: imagemarc on June 20, 2006, 07:49:06 AM
You should install the install_autoimage.php

Go to your browser and type the address like:

http://yoursiteaddress/4images/install_autoimage.php
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Jockl on July 03, 2006, 08:36:34 PM
Is it possible that this only works in particular categories?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Jockl on July 07, 2006, 12:11:27 AM
Und in Deutsch:

Ist es möglich, dass der Auto Image Resizer nur in gewissen Kategorien wirkt?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on July 07, 2006, 12:32:41 AM
No, not really...there are not per-category settings for this.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: ahbut on July 08, 2006, 06:16:45 AM
Is there any way to preserve EXIF info on the photo??
Notice after I use this mod, all pics that ahs been auto resized had lost almost all EXIF info, when I download the pics and double check on ACDSee, most infos are missing except
  X/Y Resolution, YCbCr positioning, color space, dimension and exif version, that's all...

anyway to work around it?? other then manually resize all pics using ACDSee???

Thank you
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: stefan1183 on August 03, 2006, 10:53:14 PM
hello,

does this Mod work correctly with version 1.7.3?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: blakflame on August 06, 2006, 12:33:21 PM
Quote
Step 5
Download "Autoimage Install" file.


the link is not working for me !!!!!

what the problem??
can u link it to another site ??
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on August 06, 2006, 12:46:15 PM
attached to the original post.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: blakflame on August 06, 2006, 12:47:28 PM
thank you  :D
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mikum on August 08, 2006, 12:33:31 PM
hello,

does this Mod work correctly with version 1.7.3?

I have the same question since I tried to install the mod on a 1.7.3.

When I'm logged in as another user than admin I receive messages that the image size and dimentions don't fit:

Fehler beim Upload der Bild-Datei:
IMG_0287.JPG: Die Dateigröße ist unzulässig
IMG_0287.JPG: Die Bildbreite ist unzulässig
IMG_0287.JPG: Die Bildhöhe ist unzulässig


I red all the posts regarding this issue but those hints don't help for me.

What's a bit special on my installation is just that I don't use the member.php but a copy with the name member_upload.php. The only difference is, that this copy uses another main template.

For image resizing I'm using GD library.

Cheers,
mikum
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mikum on August 09, 2006, 03:38:22 PM
hello,

does this Mod work correctly with version 1.7.3?

I have the same question since I tried to install the mod on a 1.7.3.

When I'm logged in as another user than admin I receive messages that the image size and dimentions don't fit:

Fehler beim Upload der Bild-Datei:
IMG_0287.JPG: Die Dateigröße ist unzulässig
IMG_0287.JPG: Die Bildbreite ist unzulässig
IMG_0287.JPG: Die Bildhöhe ist unzulässig


I red all the posts regarding this issue but those hints don't help for me.


Ok, probably I missunderstood what the mod realy does. I expected it to also ignore an exceeded file size.

So when the file size is bigger than allowed it will also come to the error that
  file size
  image width
  image height
are over the limit.

This is maybe a little confusing because actually it's just the file size which is causing a problem.

Cheers,
mikum
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: ccsakuweb on August 09, 2006, 05:10:00 PM
can i have the new size in my gallery but when i click in the image, a new window open with the original size? i don´t want autoresized the images from my wallpapers gallery -.-
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: tcityonline.com on August 17, 2006, 03:38:27 AM
Is there a way to adjust the size of the image so it fits into the template nicely, but when downloaded, it is the full size?  (Like the previous question, sort of).  What I am basically saying, is there a way so that when it loads, it has the
Code: [Select]
<img width="x" height="x"> attributes?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: stefan1183 on August 17, 2006, 12:47:57 PM
combine this mod (Auto image resize on upload) with that one: http://www.4homepages.de/forum/index.php?topic=3236.0 you must read 2 or 3 pages to find the information you're looking for
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: yellowmosquito on August 18, 2006, 12:51:48 AM
This mod isnt working for me. 

I think the problem has something to do with the fact that anytime i make a change to the settings on the new and improved admin/settings.php screen, they are never there after i submit the form.  When the screen comes back, those settings are completely unselected, so I dont think anything is being saved.  Does anyone have any ideas on this?

Thanks in advance!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on August 18, 2006, 01:59:31 AM
how about info about your 4images version?

try reinstall the gallery, prior delete everything from the database related to 4images.

P.S. a tip for the future: before you try to install/change anythings in the code, make sure not modifyed code working properly.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: yellowmosquito on August 18, 2006, 05:36:50 PM
I am running v1.7.2

I have a multiupload mod installed, which may or may not be affecting this mod.  However, the fact that the options dont save on the settings screen (which is completely unaffected by the multiupload mod) makes me think that the problem is with these files.  Since the settings dont save on the admin/settings.php screen when I submit the screen, I cant actually enable this mod.  Does that make sense? 


In case I am not explaining this well, these are the two settings which I can never modify:

Auto-resize image
  Yes     No
 
Auto-resize image quality
 
 When i submit the page these  elements come back blank.




My code was working properly before installing this mod, and I haven't made any changes outside of the ones mentioned in the install instructions.
I havent reinstalled the gallery, but I have reverted back to all of the original file versions (with the multiupload installed) and still cant get the admin settings screen to work.


Hope this gives you more information.  Thanks again
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: yellowmosquito on August 18, 2006, 05:56:26 PM
Okay, I figured out why it wasnt saving.

I didn't realize that i needed to run the install_autoimage.php file as a script to modify the database.  i assumed it was called within the other code.
 

Oops!! ;)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: yellowmosquito on August 18, 2006, 05:59:23 PM
Nice work on this Mod!  It works great!

Thanks!!!!  :mrgreen:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: jackald on September 12, 2006, 04:44:42 PM
What if i would like to resieze all thumbnail wich arent uploaded to my galery but there is only "http://..."   adres to them.
I understand that they cant by resiezed but only fit into specyfic sieze. How to do that?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: ishmot on September 21, 2006, 10:40:50 PM
After looking through this post and seeing that it seems like a lot of people have wondered if this mod would work with 1.7.3 I thought I would post my experience.  I wondered the same thing and have discovered that it seems to work fine with 1.7.3.  I have installed it on my updated installation and it seems to have no problems.  I did not have to run the autoimage_resize script since I had this mod previously installed prior to updating to 1.7.3

---->jared
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on September 22, 2006, 12:30:36 AM
Thanks, ishmot, for the information. I've updated the original topic.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: webejpn on September 28, 2006, 09:07:17 PM
Parse error: syntax error, unexpected '<' in /home/terrains/public_html/gallery/lang/english/admin.php on line 506


I cannot get to my Admin area, what am I doing wrong?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: wallpapers on September 28, 2006, 09:20:57 PM
Parse error: syntax error, unexpected '<' in /home/terrains/public_html/gallery/lang/english/admin.php on line 506


I cannot get to my Admin area, what am I doing wrong?

repeat step 4 of the installation
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: webejpn on September 29, 2006, 12:31:23 AM
created a fake user and logged in to see if everything worked.
not i get this error:

Parse error: syntax error, unexpected T_STRING in /home/terrains/public_html/gallery/member.php on line 64


now what did i do wrong?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: killerant on October 06, 2006, 04:32:35 PM
HI

Im trying to DL the installer but the link is not working.

Can anyone help?

Thanks Ant
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on October 06, 2006, 09:59:54 PM
its attached to the post
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: herb on October 16, 2006, 02:43:34 PM
Due to the fact, that here is a very long dicussion, I have a question:
Were ist the last advize how to change the code, or in other words:
Were can I find the "mod"

Thx in advance
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on October 16, 2006, 02:47:53 PM
here ... http://www.4homepages.de/forum/index.php?topic=7700.msg17274#msg17274
at the end ... install_autoimage.zip ...  8O
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: blackmetal on November 03, 2006, 09:24:53 AM
i install auto-resizer!
but when i go to admin/index.php i see below error (i see this error in all pages at left menu on cp,too) :

[qcode]

Warning: Cannot modify header information - headers already sent by (output started at /home/feryonli/public_html/gallery/lang/persian/admin.php:1) in /home/feryonli/public_html/gallery/admin/admin_functions.php on line 168

Warning: Cannot modify header information - headers already sent by (output started at /home/feryonli/public_html/gallery/lang/persian/admin.php:1) in /home/feryonli/public_html/gallery/admin/admin_functions.php on line 169

Warning: Cannot modify header information - headers already sent by (output started at /home/feryonli/public_html/gallery/lang/persian/admin.php:1) in /home/feryonli/public_html/gallery/admin/admin_functions.php on line 170

Warning: Cannot modify header information - headers already sent by (output started at /home/feryonli/public_html/gallery/lang/persian/admin.php:1) in /home/feryonli/public_html/gallery/admin/admin_functions.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at /home/feryonli/public_html/gallery/lang/persian/admin.php:1) in /home/feryonli/public_html/gallery/admin/admin_functions.php on line 172
[/qcode]
and when i add image , image doesn't resize!
i user 4images 1.7.3 !
what should i do?
i wait....
bye
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Entropyx on November 29, 2006, 04:43:25 AM
great mod!

i have a question, you know how when you upload the image, it gets resized? well it is possible to have the image resized but let users download the original version, the unresized one?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04) Share my experience
Post by: MarcelLainez on December 05, 2006, 09:04:05 AM
Would just like to share my experience with this mod.

I installed this mod, after following every step upto the Max Height resize, the mod won't work. I'm not getting any errors but it wouldn't resize my images.

I thought it was a problem in the mod or script, at last I discovered, it was a problem with my ImageMagick installation and NetPBM. After figuring this out, everything worked perfectly.

Just thought maybe it would save you guys from a lot of wasted debugging time. Thanks Vano!!!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: gabssnake on December 10, 2006, 11:58:08 AM
Hey! I find this MOD really usefull. it was easy to install and I didn't had any troubles. Keep up the good work.
Regards,
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: marde on December 14, 2006, 03:53:48 PM
hi! i have 2 say that ur mod is a great idea! but i have a problem with it! u have 2 know that i dont understand much about php etc but i achieved that ur mod is runnin... the only problem is the quality of the resized images. same the quality of my thumbnails. can some1 help me? any ideas?
gallery can be found www.marde.funpic.de/4images/
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on December 14, 2006, 04:04:46 PM
@ marde

ACP -> Settings -> Auto-resize image quality -> it should be > / = 85
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: marde on December 14, 2006, 04:28:47 PM
thanx for your fast support but it was 85 and i even tried it with 100! i think the problem is the gd bib. all my pics that are resized (thumbs & normal pics) are a little bit blue! but the pics that have the right height are normal and coloured but not the tumbnails. i hope u understand my problem! check my testsite www.marde.funpic.de
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on December 14, 2006, 04:44:17 PM
... with that link no check is possible ...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: marde on December 14, 2006, 04:54:15 PM
oh sry! u have to retype the link! the host doesnt allow links to his space (lol sound strange). http://marde.ma.funpic.de/4images/
edit:
i have upped the wrong constants.php. i enabled gd 2.x . but now i get a new
An unexpected error occured. Please try again later.

An unexpected error occured. Please try again later.

An unexpected error occured. Please try again later.

An unexpected error occured. Please try again later.

DB Error: Bad SQL Query: SELECT s.session_userid, s.session_expire, s.session_ip, u.user_id, u.user_level, u.user_name, u.user_ghost FROM 4images_sessions s LEFT JOIN 4images_users u ON (u.user_id = s.session_userid) WHERE s.session_expire >= 1166111946 ORDER BY u.user_id ASC, s.session_ip ASC
Unknown column 's.session_userid' in 'field list'

whats this?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on December 14, 2006, 05:08:23 PM
... Bad thumbnail quality with GD2 -> FAQ ...
... http://www.4homepages.de/forum/index.php?topic=4543.0 ...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on December 14, 2006, 05:22:31 PM
... 1. please use this -> http://www.4homepages.de/forum/index.php?action=search;advanced ...
... 2. problems with config.php, installation & database info  -> http://www.4homepages.de/forum/index.php?topic=3319.0
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on December 16, 2006, 08:08:03 AM
I have installed this mod now 4 different times and it worked everytime. However it was on all over versions like 1.7.2 and below.

I just installed it the other night on my mothers gallery (version 1.7.4) and I can see where the settings are suppose to be in the admin section. However there is no text there. I can edit the setting like turing it on or off and setting the quality, just no text saying what those funtions are. (snapshot below)
Is this something anyone has run accross before with 1.7.4?

Also when I uploaded a few images one wass bigger then the sizes I set and it did not resize like I thought it would. I am going to re-run the install_autoimage.php again and hopefull that will work.

I have already tripled checked all coding modifications and all seems to be in place properly.

If I get it to work I will post here, but if anyone has run into this please let me know what you did to fix it.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on December 16, 2006, 08:59:35 AM
I re-ran the install_autoimage.php and got 2 "unexpected errors". I assume this is because that was already modified in the database.

However I did upload a image larger then the settings and it resized it, but still no description (wording) in the control panel like the image shows in the above post.

Its no big deal if I get this to show the description as I already know what it is, but was curious if anyone else had the same issue or a fix for it.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: 1Newbie on December 18, 2006, 07:05:34 AM
OMG this Thread has been going on for over 3 Years Why hasnt a new version come out with this fix in it already?
I'd love to have this Feature.

I have my settings set to 800w and 600H and I can still upload a 1280x1024 pic. No problems,... This isnt good.
I am so confused by the 8th page in this thread that I'm not even sure what needs to be done again.

1Newb.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on December 18, 2006, 10:16:59 AM
I found out what it was, I didn't realize I had a // in front of the code in admin.php in the language part  :oops:

Must have pasted the code weird or something. Can't explain what I did, but it works now  :D


Sorry if I wasted anyones time with such a dumb question  :oops: :oops: :oops:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: 1Newbie on December 18, 2006, 05:03:19 PM
LMAO...  To my surprise.  It worked the 1st time around.  Took about 5 minutes to do.
Wow something actually went as planed.

Thank you for the Great Mod.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Rasenkantenstein on December 29, 2006, 12:29:09 AM
its attached to the post

I have downloaded the attached file... But... Well, the filename is saved, but it doesnt contain anything.. On my windows system it is 0 byte... The firewall was switched off...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on December 29, 2006, 06:40:58 AM
its attached to the post

I have downloaded the attached file... But... Well, the filename is saved, but it doesnt contain anything.. On my windows system it is 0 byte... The firewall was switched off...


Works fine for me, but here is the one I downloaded a few months back (attached). See if this download works for you.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Phade on January 17, 2007, 06:12:04 AM
Ok! I'm new to PHP and 4images but I have this mod currently working. Very easy follow the process no big deal but how do I auto-resize my thumbnails on upload? Im confused I tried to read all the pages I know v@no said it does not do that but has anyone else come out with anything like that. I would assume someone has and if so please point me to it! :) thanks.

*Update!@

So basicly you upload the file but with no thumbnail. And the other settings auto generate a thumbnail for you? Am I correct here?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on January 17, 2007, 07:03:05 AM
So basicly you upload the file but with no thumbnail. And the other settings auto generate a thumbnail for you? Am I correct here?
Yes that is correct so there is no need to upload a thumbnail.

Otherwise to set your thumbnail size look in admin control panel.
Go to: setttings then upload settings. Set your max width and height there.

I don't believe the auto resize works on thumbs, however I have never tried as I have no use for that with the above option working.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Foto-Portal on January 17, 2007, 01:01:09 PM
thx V@no.

works wonderfull.....

Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: bitf on January 18, 2007, 11:10:37 AM
how to save EXIF information after image resize?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: wallpapers on January 20, 2007, 12:56:03 PM
can this also when a admin upload a image in the admin panel? :roll:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Foto-Portal on January 20, 2007, 03:28:50 PM
can this also when a admin upload a image in the admin panel? :roll:

@wallpapers

Hi wallpapers,

frome where can i download your template of tuned-cars?
thx

Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: wallpapers on January 20, 2007, 08:50:19 PM
can this also when a admin upload a image in the admin panel? :roll:

@wallpapers

Hi wallpapers,

frome where can i download your template of tuned-cars?
thx



You can download the orginal on: http://www.vierstra.com/4images.htm (http://www.vierstra.com/4images.htm) (4reds)
I have edit some things but it's not diffecult :D


But my question is very inported for me :roll:
can this mod also when a admin upload a image in the admin panel?  :D
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on January 20, 2007, 10:40:49 PM
Quote
But my question is very inported for me :roll:
can this mod also when a admin upload a image in the admin panel?  :D

I never use admin to upload now that I have this mod and I also use multiupload Mod so uploading in the ACP is almost useless for me.  :wink:
However in ACP it didn't work for me, I had to resize it after upload. Maybe I got settings wrong or soemthing.  :?:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: wallpapers on January 20, 2007, 11:40:05 PM
Quote
But my question is very inported for me :roll:
can this mod also when a admin upload a image in the admin panel?  :D

I never use admin to upload now that I have this mod and I also use multiupload Mod so uploading in the ACP is almost useless for me.  :wink:
However in ACP it didn't work for me, I had to resize it after upload. Maybe I got settings wrong or soemthing.  :?:

It's maybe the only solution to let a admin upload his pictures in the catagory.

Thanks for your message.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: hum on January 23, 2007, 03:27:26 PM
I couldn't understand about this MOD. Lets say if you set your maximum size of image to 2048x1360 then what this MOD do? My requirements are as follow:
--> maximum size of image to upload 2048x1360 (by users)
--> auto resize image to 600x800 during upload and no need original image
Please help.
Thank you.

------------------------------------------
silly me. done - thank you.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on January 23, 2007, 09:43:08 PM
I couldn't understand about this MOD. Lets say if you set your maximum size of image to 2048x1360 then what this MOD do? My requirements are as follow:
--> maximum size of image to upload 2048x1360 (by users)
--> auto resize image to 600x800 during upload and no need original image

Just what it says in the first post
Quote
will resize uploaded by users images to Max. Image Width set in settings
So you have in your settings for max with 600, then anything that gets uploaded over that amount will be reduced to your maxwdith size.
So you make your settings 600x800 and anything above that width will be resized to that width.

If you want to make max heght as well then follow the last step:
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 (http://www.4homepages.de/forum/index.php?topic=7058.0)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: hum on January 24, 2007, 05:32:25 AM
Thank you SeeZe for detail instruction, its done now.
hum
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on January 24, 2007, 06:48:25 AM
Thank you SeeZe for detail instruction, its done now.
Seeze  :?: :?:  :?
However you are welcome.

One thing I forgot to mention. The largest file that can be uploaded is what you have set to your max KB or MB (however you look at it) in ACP and server setting.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: IWS_steffen on January 29, 2007, 06:23:56 PM
Hallo,
bin gerade beim installieren des MOD`s. 

Bei der install_autoimage.php bekomme immer wieder diese Antwort

Quote
An unexpected error occured. Please try again later.

Hat vielleicht jemand eine Idee?

Gruß Steffen
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on January 30, 2007, 11:16:04 AM
Hast Du das Script ggf zweimal aufgeführt?
Schaue mal in die Datenbank ob in der Tabelle XXX_settings ob dort ein Eintrag auto_image und ein auto_image_quality vorhanden sind...

Diese Einträge kannst Du ggf auch manuell vornehmen...

Einfach setting_name=auto_image & setting_value=0 und setting_name=auto_image_quality & setting_value=85 in die settings Tabelle eintragen..
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: IWS_steffen on January 31, 2007, 08:50:30 PM
Danke für den Tipp,

ich habe zwar den Server gewechselt, aber nach Datenbankbackup wurde tatsächlich die Tabelen mit angelegt.

Klasse Programm

Gruß Steffen
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Daniel on February 21, 2007, 06:53:18 PM
Ich habe denMod eingebaut aber einen sehr eigenwilligen Fehler.
Ich habe den Mod mehrfach kontrolliert.
Eingestellt ist max 900 breite

Lade ich ein 1000 breites Bild hoch so resized er wunderbar auf 900
Lade ich das selbe ild mit 1500 breite hoch, brcht er ab ohne Fehlercoe, Seite kann nicht nagezeigt werden.

Weiß da jemand Rat?

Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on February 21, 2007, 07:47:51 PM
zu wenig speicher...

hoster anbetteln das er die werte erhöht oder hoster wechseln, dann kannste dich ja mal bei mir melden...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Daniel on February 21, 2007, 08:08:12 PM
1GB Ram, eigener Server, Dual-XEON
Das kann also nicht sein.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on February 21, 2007, 08:10:30 PM
haste einen root?

und so wenig ahnung?

viel spass!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Daniel on February 21, 2007, 08:22:33 PM
OK 2GB Ram

Sollten doch locker reichen. Ist kein Root.

Ich denke das es weil es mit einem 1000Bild klappt sollte es doch eigentlich auch mit einem 1500 Bild klappen ?
Es ist kaum größer (von der kbZahl her) ...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on February 21, 2007, 09:12:23 PM
Das hat nichts mit dem RAM zu tun...

Dem PHP musst mehr Speicher zugewiesen werden...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Daniel on February 22, 2007, 05:22:47 AM
Kann man das in derp hpinfo sehen?

memory_limit  12M     12M

steht da.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on February 22, 2007, 01:01:35 PM
max_execution_time
max_input_time

Das sind auch interessante Werte und 12MB von 2GB sind ja lächerlich... (o:

Also was bringen Dir die 2GB Ram beim Bilder bearbeiten wenn Du nur 12MB zur verfügung hast?
Richtig, nichts... (o:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Daniel on February 22, 2007, 02:52:38 PM
infos auf phpinfo:

max_execution_time  30   30
max_input_time         -1    -1

Was die -1 bedeuten weiß ich nicht, das andere sind Sekunden.
Meinst du ich sollte die 30 Sekunden hochsetzen  und die  memory_limit auch nach oben?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Acidgod on February 22, 2007, 03:43:54 PM
Also 30 sec ist natürlich sehr wenig...

Denn dies bedeutet wenn das Script länger wie 30 sec. läuft das es abgebrochen wird...

120 sec. sind bestimmt ausreichend...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Daniel on February 23, 2007, 05:09:44 PM
Hi Acidgod,

ich habe die
max_execution_time  auf 180
und den
memory_limit auf 100
gesetzt...
...und siehe da, es geht.

Ich möchte mich an dieser Stelle für diesen Tip bei dir bedanken.

GROßEN DANK!!!!!!!!!! :D

Der Daniel
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: manyaq on April 19, 2007, 09:20:42 PM
i installed this mod and worksperfect. But i am intrested does this mod work with 1.7.4 multi upload mod.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on April 25, 2007, 08:16:45 AM
i installed this mod and worksperfect. But i am intrested does this mod work with 1.7.4 multi upload mod.
Mine works with multi upload
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: manyaq on April 25, 2007, 01:42:43 PM
i installed this mod and worksperfect. But i am intrested does this mod work with 1.7.4 multi upload mod.
Mine works with multi upload
cejay did you use annotion asswell
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on April 27, 2007, 08:40:28 AM
i installed this mod and worksperfect. But i am intrested does this mod work with 1.7.4 multi upload mod.
Mine works with multi upload
cejay did you use annotion asswell


Yes I did.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: masterred on May 04, 2007, 03:41:43 PM
algo parecido, pero no deja crear tema el foro  :D

tengo este MOD en mi galeria,
http://www.4homepages.de/forum/index.php?topic=8105.msg37316#msg37316 (http://www.4homepages.de/forum/index.php?topic=8105.msg37316#msg37316)

solo que me gustaria que en la imagen origina o popup, no importa que sea en html. para poder crear esos campos y aparecieran los datos, de details.html

descripcion, palabras claves,autor, votos, rating y eliminar los que trae por defecto.

gracias
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: kabahsito on May 18, 2007, 02:57:32 AM
Remove gallery???? The Download???
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on May 18, 2007, 08:22:07 PM
Remove gallery???? The Download???
What you say makes no sense.  ???
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: kabahsito on May 18, 2007, 11:33:10 PM
Autoimage Installhttp://gallery.vano.org/file5dl (http://gallery.vano.org/file5dl) step 5 Remove gallery Vano!!!!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on May 19, 2007, 06:42:14 AM
This is all I see for 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

Then after you use the install_autoimage.php you delete that file from your website.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Smoothice on May 22, 2007, 02:32:19 AM
Is there a way to adapt this script to auto resize the thumbnail upon user upload to the ACP settings?  I have been uploading thumbnails and they are too big then I have to goto the ACP to adjust them.  This is fine for when I am uploading but not when other users are.  Any help would be greatly appreciated.

Aaron
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Smoothice on May 27, 2007, 06:34:33 AM
Is there a way to adapt this script to auto resize the thumbnail upon user upload to the ACP settings?  I have been uploading thumbnails and they are too big then I have to goto the ACP to adjust them.  This is fine for when I am uploading but not when other users are.  Any help would be greatly appreciated.

Aaron

Still looking  for a way to do this.  Has anyone been successful?  I have triedbut am not that good of a coder.

Aaron
Title: missing Autoimage installer!!
Post by: laci on June 03, 2007, 01:22:19 AM
I didn't find the autoimage installer, pls help me! Where can i find it? Please give me a link, or send it to my email!

Thanks a lot!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: manurom on June 03, 2007, 01:44:58 AM
Hello;
you will find it here: Install_autoimage.zip (http://www.4homepages.de/forum/index.php?action=dlattach;topic=7700.0;attach=874)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Smoothice on June 03, 2007, 08:43:05 PM
Not sure if anyone has come accross this before but when I upload a file not from the ACP it uploads but when it goes to show you on the next page it displays the wrong image or video.  I have have no idea where to look to solve the problem.  Any help is appreciated.

Smoothice
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: knsin0 on June 10, 2007, 02:12:00 AM
great mod but dont work from de "add image" of the admin panel, how can i enable it?  :|
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on June 10, 2007, 08:55:32 AM
great mod but dont work from de "add image" of the admin panel, how can i enable it?  :|
You need to set your image setting in Admin Control Panel for this to work.
Under "Settings" choose "Upload Settings".
Now look for "Auto-resize image" and set to YES
Right below that you select your quality. I suggest somewhere between 93% and 100% (% sign not needed).

Once you have that set all should work as mine does. If not you can resize images using the "Auto-Image-Resizer" in the Admin Control Panel.
As posted prior to this:
Quote from: knuckles
1) If you use the Control Panel to upload, the images and thumbnails don't get scaled.  This could almost be a feature, but I'd rather it be an option.
I didnt plan integrate it into admin control panel, becase there is already half automated fetures - auto resize images/thumbnails.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: knsin0 on June 10, 2007, 10:58:22 PM
Thanks for the answer, now it works perfectly  :wink:
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: gborislav on June 16, 2007, 04:12:49 PM
Hi guys,

I need you help
I did everything as V@no  wrote.
And I found new options in section image upload

Auto-resize image
Auto-resize image quality

After I put yes on Auto-resize image and then put
the Auto-resize image quality and then save it , it does not save the settings.

What could be the problem ?

Thank you.

Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on June 16, 2007, 05:02:10 PM
Hi guys,

I need you help
I did everything as V@no  wrote.
And I found new options in section image upload

Auto-resize image
Auto-resize image quality

After I put yes on Auto-resize image and then put
the Auto-resize image quality and then save it , it does not save the settings.

What could be the problem ?

Thank you.


Re-Run step 5, i am sure that is your problem right now.

Quote
Step 5
Download "Autoimage Install (http://www.4homepages.de/forum/index.php?action=dlattach;topic=7700.0;attach=874)" file.

Unzip it and upload to your 4images ROOT dir.
Start it http://yoursiteaddress/4images/install_autoimage.php
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: gborislav on June 16, 2007, 05:27:35 PM
Hi,

Yes, Thanks is works , but now not resizing.

I setup Conversion tool for thumbnails --> GD

Max. image width in pixel --> for 1000
 
Max. image height in pixel --> for 1000

Auto-resize image --> yes
 
Auto-resize image quality --> 100

Auto-create thumbnail --> yes

Thumbnail size in pixel --> 200


I checked again all changes what I done , Not resizing.

So how to resolve this problem.

Thanks again.
 
 
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on June 16, 2007, 07:40:25 PM
If uploading in ACP you have to use the resizer in ACP. Otherwise if you upload as a member it should work if all settings are correct.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: gborislav on June 17, 2007, 08:13:45 AM
Hi,

As I understand right this mod  "auto resize image" for users only ( upload images from front site)
If I uploading image from control panel I need to use Auto-Image-Resizer. Right?

I tryed upload images from front site, is working.

Thanks again.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CeJay on June 18, 2007, 06:04:54 PM

As I understand right this mod  "auto resize image" for users only ( upload images from front site)
If I uploading image from control panel I need to use Auto-Image-Resizer. Right?
Correct, however you can upload from the upload page logged in as admin and it will work that way. Just when uploading in ACP you need to resize them.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Philmax on July 29, 2007, 02:14:13 PM
I have done the installation like the guide on the first site of this topic, but it doesn´t run!
When i upload an bigger image, i got the error, that the image is to big.

Can u look, where the error is?

Here my member.php (http://fotos-zeigen.de/info/member.txt) and my upload.php (http://fotos-zeigen.de/info/upload.txt).

The setting in the admin panel i have done.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Loda on July 29, 2007, 05:17:01 PM
I have done the installation like the guide on the first site of this topic, but it doesn´t run!
When i upload an bigger image, i got the error, that the image is to big.

Can u look, where the error is?

Here my member.php (http://fotos-zeigen.de/info/member.txt) and my upload.php (http://fotos-zeigen.de/info/upload.txt).

The setting in the admin panel i have done.

i don't know.. but in your upload.php i missed a little thing:
after this:
Code: [Select]
var $lang = array();you insert this:
Code: [Select]
var $upload_errors = array();are you sure that you have install the auto_image and auto_image_quality tables in your database?            
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Philmax on July 29, 2007, 05:49:02 PM
i don't know.. but in your upload.php i missed a little thing:
after this:
Code: [Select]
var $lang = array();you insert this:
Code: [Select]
var $upload_errors = array();
I can´t find anything diffrent to the install guide on the first site of this topic.

are you sure that you have install the auto_image and auto_image_quality tables in your database?            
Yes I am.

Other ideas?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: egyptsons on July 29, 2007, 05:49:56 PM
worked fine with no problem
Thanks V@n 8)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Loda on July 29, 2007, 06:06:35 PM
@philmax
look here:
http://www.4homepages.de/forum/index.php?topic=7700.msg21559#msg21559
maybe...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Philmax on July 30, 2007, 06:33:11 PM
Ok, the is an error on the installation:
An unexpected error occured. Please try again later.

How can i install it with phpmyadmin?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on August 04, 2007, 02:18:56 PM
Hallo Ivan,

... eigentlich hast du dir deine Frage mit den richtigen Links schon beantwortet ... ;)
... so wie mir V@no die Lösung vorgeschlagen hat (... dein 2.Link ...), so habe ich es dann auch umgesetzt ...
... und funktioniert noch heute so bei mir ...
... d.h. also, wenn Dateien mit der Extension *.rm , *.ram (... umbenannte *.jpg-Dateien als Panorama ...) via
    Website hochgeladen werden, so werden sie nicht durch diesen MOD hier verkleinert ...
... du müsstest das eigentlich analog umsetzen können, wobei du nur eine andere Extension (... ich glaube bei
    dir ist es *.pano ...) verwendest bzw. dort dann einsetzen müsstest ...
... teste den Panoramaupload bei mir ... wenn du es umgesetzt hast, dann teste ich es bei dir ... ;)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CosmoPhobia on August 19, 2007, 09:50:56 PM
Ich habe den Mod installier, aber bei einigen Bildern (nicht bei allen, aber alles jpg-Dateien) läd er das Bild hoch, glaubt man jedenfalls, und dann kommt eine weiße Seite, in der Adresszeile steht die Domain und /member.php, und das Bild wurde nicht hochgeladen.
Woran kann das liegen ? Habe den Mod jetzt schon 2. mal installiert, aber es will nicht. Nutze 1.7.4

------------------------

I´ve installed the Mod, but by a few pics (not by all, but allways jpg-files) it seems that 4images is uploading the image, and then, after a while, a blank white page is coming, with www.domain.de/member.php in the adress field, and the image wasn´t uploaded.
Whats the reason ? I´ve installed the mod again...same Problem. I´m using 1.7.4

Thank you for helping.
Cosmo

EDIT:
Manchmal bekomm ich eine Fehlermeldung wie "Internal Server Error - Bitte kontaktieren Sie Ihren HOster". Kann das vielleicht eine Servereinstellung des Hosters sein ? Ich selbst konnte zwischen php5 und php4 wählen, habe 4 genommen. Kann das der Grund sein ?

-------------------

Sometimes i get an Error like "Internel Server Error - contact your Hoster". Can the Problem be a Server-Option, that the hoster has deactivated ? I´ve changed the server from php5 to php4, maybe this is the reason ?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CosmoPhobia on August 19, 2007, 10:29:15 PM
Hi.
Danke für deine Antwort.
Ich hatte es bereits mal auf 2000 kb, und da hat es auch nicht geklappt. Das komisch ist nur, es kommt nicht bei jedem Bild dieser Fehler.
Bei Wallpapern, die ich z.b. aus dem Netz runtergeladen habe, geht es bei z.b. 1,9 mb wunderbar.
Wenn ich allerdings ein Bild meiner Digitalkamera auf 1,8 oder 1,9 mb reduziere, und das dann versuche hochzuladen, dann kommt die weiße Seite.
Alles sehr merkwürdig.

Noch eine Idee ?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CosmoPhobia on August 20, 2007, 03:29:45 PM
I´ve watchedd on my server, and the picture i was trying to upload is in the "data" directory. but it is not full uploaded, only 1,6 from 1,9 mb are uploaded. Why this ?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on August 20, 2007, 03:48:23 PM
Max upload limit reach.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CosmoPhobia on August 20, 2007, 05:22:14 PM
My max Upload limit is 3mb.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on August 20, 2007, 05:24:40 PM
What is exact error message (server) ?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CosmoPhobia on August 20, 2007, 05:58:40 PM
No error Message, only a blank page i see.
Only sometime i get a message like "Internal Server Error - Contact Server Admin".
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on August 20, 2007, 05:59:42 PM
1- What is web error log say from host cPanel ?
2- Use error_reporting(E_ALL); from global.php and go back to blank page.

Error should appear both.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: aminhd on September 15, 2007, 07:18:26 PM
um...it's not working for me. I've done everything step by step 2 times now. I see new options under "Upload Settings" yet when I try to select it and click "Save Changes," it won't save. I would go back to the settings and find that it is set to "no." :(
Anyone have any suggestions?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on September 15, 2007, 07:59:23 PM
If use my step before your post ... is say for error if try save again ?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: aminhd on September 16, 2007, 04:40:30 AM
There is no error messages whatsoever. It just won't save the settings.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on September 16, 2007, 05:50:15 AM
- Which PHP version ?
- Which mySQL version ?
- Which 4images version ?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: aminhd on September 17, 2007, 02:27:25 AM
PHP Version 5.2.3
MySQL 5.0.45
4images 1.7.4

Thank you for helping me. :)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on September 17, 2007, 02:50:43 AM
This MOD no support PHP v5.2.x right now ... sorry.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: aminhd on September 18, 2007, 01:38:20 AM
hmm...no wonder it didn't work. I thought it was just "me." :roll:
Oh well, I'll just stick with it for right now. Thank you.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Kenny1980 on September 23, 2007, 01:24:10 PM
Hi Guys,
i had the same Problem as aminhd.

No error and a blank screen. and when i will reload it, then there´s the lost password screen.

Sql Version is 4.1.13
Php Version is 4.4.0


The funny thing is, when i will upload an Pic with 2560*1920 and 2,4MB theres no error the pic is online, but with other pics with 2816*2112 and 1.3Mb only comes the error.

i hope someone can help me. 4Images is the latest Version. It´s only another Design (KW) this Mod and the Mod where the Users can create the own categories.

greets
Kenny
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on September 23, 2007, 01:30:35 PM
Quote
when i will reload it, then there´s the lost password screen.
The funny thing is, when i will upload an Pic with 2560*1920 and 2,4MB theres no error the pic is online, but with other pics with 2816*2112 and 1.3Mb only comes the error.

ahHA ! 2 thing possible:

1 - Session expire for no use $site_sess or redirect.
2 - Server expire session for large upload file.

Solution: Check web logs for see problem. ;)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Kenny1980 on September 23, 2007, 05:11:18 PM
Hi,

1 i set the times in the PHP.ini to 90 seconds
2 i set the max file to 4mb


where i can see the web log?

greets
Kenny
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on September 23, 2007, 05:45:08 PM
Quote
where i can see the web log?

FTP or cPanel access from host.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Kenny1980 on September 24, 2007, 12:07:22 AM
Hi,
after i checked my logs i see, that the Resource Limit is the Problem in the php.ini

Now i set the memory_limit = 45M and it runs without any problems.


greets
Kenny
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on September 24, 2007, 01:50:55 AM
45M is high for ressource ... what if 32M ?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Kenny1980 on September 24, 2007, 12:13:28 PM
Hi,
at 32M there comes a error.

greets
Kenny
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on September 24, 2007, 12:46:59 PM
Wow ... what is server specs exact ?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: monkey on September 28, 2007, 05:14:18 AM
i know this is freaking old post but i cant get this download on page 1 of installation to work for me, the link just times out, I tried saving it too and it was an html file which is not what i need.
Is there somewhere else I can find this install file?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on September 28, 2007, 09:04:13 AM
... at the bottom of the first post you can find the link ...
... install_autoimage.zip (1.53 KB - runtergeladen 1078 Mal.) ...
... be No. 1079 ... ;)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Lory on October 11, 2007, 12:50:29 AM
Hi guys.
I have one problem, the mod doesn't work.
I have done the step by step exactly and there aren't error in the code,but,
In the admin's panel when i set on "yes" the option Auto-Resize Image, If I save the change(on yes),automatically the admin's panel exchange again the set option on "NO".
i have try to upload a image for testing the resize, but don't work

what is the solution for this problem?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on October 11, 2007, 01:15:18 AM
Quote
i have try to upload a image for testing the resize, but don't work

what is the solution for this problem?

To say what is say after upload image. Error message ?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Lory on October 11, 2007, 05:29:29 AM
no, nothing error. the upload is correct but the image non resized.
In the admin's panel when i set on "yes" the option Auto-Resize Image, If I save the change(on yes),automatically the admin's panel exchange again the set option on "NO".
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on October 11, 2007, 06:34:32 PM
Ok, so follow step 1, step 2 and step 3 of my signature. Is possible is something of the 3.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Lory on October 11, 2007, 07:43:31 PM
step 1 ----- add code in member.php
find

Code: [Select]
if (!$uploaderror) {above insert
Code: [Select]
//--------------------------------------------
//---------Start Code Auto Image Resizing --------------
//--------------------------------------------
                  if ($config['auto_image'] && !$uploaderror) {
                     if ($direct_upload) {
                        $src = MEDIA_PATH."/".$cat_id."/".$new_name;
                    }
                    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');
                        }
                  if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
                       $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, $config['max_image_height'])) {
                           $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name;
                                 $uploaderror = 1;
                          }
                           }
                        }
                     }
                  }
//---------------End Code auto Image Resizing----------------------------

step 2 ----- add code in /includes/upload.php
find
Code: [Select]
$this->max_height['media'] = $config['max_image_height'];below insert
Code: [Select]
   
 //---------Start Code Auto Image Resizing (part 1)----
 $this->auto_image['media'] = $config['auto_image'];
 //---------End Code Auto Image Resizing (part 1)----

step 2.2 ----- add code in /includes/upload.php
find
Code: [Select]
    if ($this->image_size[1] > $this->max_height[$this->image_type]) {
      $ok = 0;
      $this->set_error($this->lang['invalid_image_height']);
    }
below insert
Code: [Select]
         //---------Start Code Auto Image Resizing (part 2)----
          if ($this->auto_image[$this->image_type]) {
         $ok = 1;
      }
      //---------End Code Auto Image Resizing (part 2)----

step 3 ----- add code in  /admin/settings.php
find
Code: [Select]
show_setting_row("upload_emails");below insert
Code: [Select]
  //---------Start Code Auto Image Resizing ----
  show_setting_row("auto_image", "radio");
  show_setting_row("auto_image_quality");
 //---------Start Code Auto Image Resizing ----

step 4 ----- add code in /lang/italian/admin.php
find
Code: [Select]
$setting['auto_thumbnail_quality'] = "Thumbnail quality<br /><span class=\"smalltext\">0 to 100</span>";below insert
Code: [Select]
/*-- START CODE AUTO RESIZE IMAGE --*/
$setting['auto_image'] = "Auto-resize image";
$setting['auto_image_quality'] = "Auto-resize image quality";
/*-- END CODE AUTO RESIZE IMAGE --*/

this is all my step.
i dont have install another mod.

Version 4images 1.7.4
PHP Version 5.2.0


i wait your help guys.
if all it works I buy 2 license for my sites, but if dont work i cannot use it :(
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on October 11, 2007, 08:18:02 PM
Quote
PHP Version 5.2.0

Please read step 7 on my signature for this.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Lory on October 11, 2007, 08:41:42 PM
i have done step 7 but nothing change.

pls read this..


i try to upload one image with dimension 1550x1000pix. in the admin pannel i have setting max width and heigth on 445pix
when i go to upload the image apper this message:

i post attachment screenshot:

P.S. identical problem with php4.4.6
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: thunderstrike on October 11, 2007, 08:43:19 PM
Quote
i have done step 7 but nothing change.

Is no for change - is for read  :!:

No answer for this problem with PHP v5.2+.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: kai on November 27, 2007, 12:12:09 PM
A video tutorial of this mod can be watched here:

http://www.asian-lady.org/tutors/resize-mod/resize-mod.html
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: kotyara on January 04, 2008, 12:10:45 AM
install this mod, but have some problem. Size of pic, not auto change and then try to change in acp see this:
Code: [Select]
Конвертировать файл фотографии: PIC_0078_2.jpg (1600x1200) ....  
Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /opt/lampp/htdocs/gallery/includes/image_utils.php on line 74

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /opt/lampp/htdocs/gallery/includes/image_utils.php on line 82

Warning: imagejpeg(): supplied argument is not a valid Image resource in /opt/lampp/htdocs/gallery/includes/image_utils.php on line 93

Warning: imagedestroy(): supplied argument is not a valid Image resource in /opt/lampp/htdocs/gallery/includes/image_utils.php on line 95

   Ошибка при конвертировании файла фотографии!
host: Apache/2.2.4, PHP/4.4.7, MYSQL 5.0.41
gallery: 1.7.4
mod: signature on upload
gd - is ok thum is greats.
sorry for bad english)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Nicky on January 04, 2008, 12:29:13 AM
please sent a link to this picture, i installed this mod today and its work...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: kotyara on January 04, 2008, 12:21:52 PM
ops, sorry but gallery on localhost server.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Nicky on January 04, 2008, 12:59:10 PM
send this picture to my email: 4images AT nicky DOT net
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: kotyara on January 04, 2008, 04:03:23 PM
send this picture to my email: 4images AT nicky DOT net
I'm sent u a letter. thx.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Nicky on January 04, 2008, 08:57:09 PM
okay.

PIC is okay.. image_utils.php is 100% like mine, there was no changes for this MOD.

maybe you did something wrong ..

i see that you have a watermark on your picture... maybe you did something wrong by "MOD Annotation"..
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: afe on January 25, 2008, 04:28:25 AM
Can anyone tell me why I am getting this please. "Parse error: syntax error, unexpected ')' in /home/athletes/public_html/gallery/includes/upload.php on line 97" Thank you.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: maineyak on February 23, 2008, 08:39:05 PM
I installed this no problem.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: anoleimage on February 23, 2008, 10:31:16 PM
Does this work with the most recent version (1.7.6)?

I tried to follow the procedure as described here, but nothing shows up in the control panel under settings.  I have PHP 4.4.4 and everything else seems compatible.  But this was last updated four years ago, so I'm wondering if this is still a valid mod, or if anyone has a more current one?

Thanks in advance...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: maineyak on February 23, 2008, 11:12:27 PM
Does this work with the most recent version (1.7.6)?

I tried to follow the procedure as described here, but nothing shows up in the control panel under settings.  I have PHP 4.4.4 and everything else seems compatible.  But this was last updated four years ago, so I'm wondering if this is still a valid mod, or if anyone has a more current one?

Thanks in advance...

Yes
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: anoleimage on February 24, 2008, 03:48:40 AM
Got it!  I must have had a comma out of place or something.  It definitely does work in 1.7.6.

Thank you for your reply.


Now, if I could only have different resizing requirements for different user groups... but I guess that should be under requests.  ;)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: squalls_dreams on March 08, 2008, 10:56:55 PM
I clicked on the link for the installer and it just brings me to a blank page. Where can I download the installer?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: squalls_dreams on March 09, 2008, 07:56:05 AM
alright I was just wondering what does this mod do? I'm thinking in the title it auto resized the images of course right? but ok so when I go to upload an image, the image still shows up as its regular size and it screws up my whole 4images layout. what am I doing wrong?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: saab on March 30, 2008, 03:05:52 AM
Hello. I have following problem:
All steps are done and checked few times. This MOD works just perfect for me as administrator, but when regular user tries to upload file bigger than allowed in control panel he received warning message that image's width and size is bigger than allowed. How can I fix this, because I want this MOD to work for all my users.

I have 4images 1.7.6
I use GD Bibliotek.

server is on SAFE MODE

Here is some info about server where 4images ius running:

Code: [Select]
PHP Version 5.2.5-3
Apache/2.2.8 (Debian) PHP/5.2.5-3 with Suhosin-Patch mod_perl/2.0.3 Perl/v5.8.8

gd
GD Support  enabled 
GD Version  2.0 or higher 
FreeType Support  enabled 
FreeType Linkage  with freetype 
FreeType Version  2.3.5 
T1Lib Support  enabled 
GIF Read Support  enabled 
GIF Create Support  enabled 
JPG Support  enabled 
PNG Support  enabled 
WBMP Support  enabled 



Also - here is my UPLOAD.PHP file:

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: upload.php                                           *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die(
"Security violation");
}

if (!
function_exists("is_uploaded_file")) {
  function 
is_uploaded_file($file_name) {
    if (!
$tmp_file = @get_cfg_var('upload_tmp_dir')) {
      
$tmp_file tempnam('','');
      
$deleted = @unlink($tmp_file);
      
$tmp_file dirname($tmp_file);
    }
    
$tmp_file .= '/'.get_basefile($file_name);
    return (
ereg_replace('/+''/'$tmp_file) == $file_name) ? 0;
  }

  function 
move_uploaded_file($file_name$destination) {
    return (
is_uploaded_file($file_name)) ? ((copy($file_name$destination)) ? 0) : 0;
  }
}

class 
Upload {

  var 
$upload_errors = array();
  var 
$accepted_mime_types = array();
  var 
$accepted_extensions = array();
  var 
$upload_mode 3;

  var 
$image_type "";
  var 
$max_width = array();
  var 
$max_height = array();
  var 
$max_size = array();
  var 
$upload_path = array();

  var 
$field_name;
  var 
$file_name;
  var 
$extension;

  var 
$image_size 0;
  var 
$image_size_ok 0;
  var 
$lang = array();

  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->max_size['thumb'] = $config['max_thumb_size'] * 1024;
    
$this->max_size['media'] = $config['max_media_size'] * 1024;

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

    
$this->set_allowed_filetypes();
  }

  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;
  }

  function 
copy_file() {
    switch (
$this->upload_mode) {
    case 
1// overwrite mode
      
if (file_exists($this->upload_path[$this->image_type]."/".$this->file_name)) {
        @
unlink($this->upload_path[$this->image_type]."/".$this->file_name);
      }
      
$ok move_uploaded_file($this->upload_file$this->upload_path[$this->image_type]."/".$this->file_name);
      break;
    case 
2// create new with incremental extention
      
$n 2;
      
$copy "";
      while (
file_exists($this->upload_path[$this->image_type]."/".$this->name.$copy.".".$this->extension)) {
        
$copy "_".$n;
        
$n++;
      }
      
$this->file_name $this->name.$copy.".".$this->extension;
      
$ok move_uploaded_file($this->upload_file$this->upload_path[$this->image_type]."/".$this->file_name);
      break;
    case 
3// do nothing if exists, highest protection
    
default:
      if (
file_exists($this->upload_path[$this->image_type]."/".$this->file_name)) {
       
$this->set_error($this->lang['file_already_exists']);
       
$ok 0;
      }
      else {
        
$ok move_uploaded_file($this->upload_file$this->upload_path[$this->image_type]."/".$this->file_name);
      }
      break;
    }
    @
chmod($this->upload_path[$this->image_type]."/".$this->file_nameCHMOD_FILES);
    return 
$ok;
  }

  function 
check_max_filesize() {
    if (
$this->HTTP_POST_FILES[$this->field_name]['size'] > $this->max_size[$this->image_type]) {
      return 
false;
    }
    else {
      return 
true;
    }
  }

  function 
save_file() {
    global 
$user_info;

    
$this->upload_file $this->HTTP_POST_FILES[$this->field_name]['tmp_name'];
    
$ok 1;
    if (empty(
$this->upload_file) || $this->upload_file == "none") {
      
$this->set_error($this->lang['no_image_file']);
      
$ok 0;
    }

    if (
$user_info['user_level'] != ADMIN) {
      if (!
$this->check_max_filesize()) {
        
$this->set_error($this->lang['invalid_file_size']);
        
$ok 0;
      }
      if (
eregi("image"$this->HTTP_POST_FILES[$this->field_name]['type'])) {
        if (!
$this->check_image_size()) {
          
$ok 0;
        }
      }
    }

    if (!
$this->check_file_extension() || !$this->check_mime_type()) {
      
$this->set_error($this->lang['invalid_file_type']. " (".$this->extension.", ".$this->mime_type.")");
      
$ok 0;
    }
    if (
$ok) {
      if (!
$this->copy_file()) {
        if (isset(
$this->lang['file_copy_error'])) {
          
$this->set_error($this->lang['file_copy_error']);
        }
        
$ok 0;
      }
    }
    return 
$ok;
  }

  function 
upload_file($field_name$image_type$cat_id 0$file_name "") {
    global 
$HTTP_COOKIE_VARS$HTTP_POST_VARS$HTTP_GET_VARS$HTTP_POST_FILES;

    
// Bugfix for: http://www.securityfocus.com/archive/1/80106
    
if (isset($HTTP_COOKIE_VARS[$field_name]) || isset($HTTP_POST_VARS  [$field_name]) || isset($HTTP_GET_VARS   [$field_name])) {
      die(
"Security violation");
    }

    
$this->HTTP_POST_FILES $HTTP_POST_FILES;
    
$this->image_type $image_type;
    
$this->field_name $field_name;

    if (
$cat_id) {
      
$this->upload_path['thumb'] = THUMB_PATH."/".$cat_id;
      
$this->upload_path['media'] = MEDIA_PATH."/".$cat_id;
    }
    else {
      
$this->upload_path['thumb'] = THUMB_TEMP_PATH;
      
$this->upload_path['media'] = MEDIA_TEMP_PATH;
    }

    if (
$file_name != "") {
      
ereg("(.+)\.(.+)"$file_name$regs);
      
$this->name $regs[1];
      
ereg("(.+)\.(.+)"$this->HTTP_POST_FILES[$this->field_name]['name'], $regs);
      
$this->extension $regs[2];
      
$this->file_name $this->name.".".$this->extension ;
    }
    else {
      
$this->file_name $this->HTTP_POST_FILES[$this->field_name]['name'];
      
$this->file_name ereg_replace(" ""_"$this->file_name);
      
$this->file_name ereg_replace("%20""_"$this->file_name);
      
$this->file_name preg_replace("/[^-\._a-zA-Z0-9]/"""$this->file_name);

      
ereg("(.+)\.(.+)"$this->file_name$regs);
      
$this->name $regs[1];
      
$this->extension $regs[2];
    }

    
$this->mime_type $this->HTTP_POST_FILES[$this->field_name]['type'];
    
preg_match("/([a-z]+\/[a-z\-]+)/"$this->mime_type$this->mime_type);
    
$this->mime_type $this->mime_type[1];

    if (
$this->save_file()) {
      return 
$this->file_name;
    }
    else {
      return 
false;
    }
  }

  function 
check_file_extension($extension "") {
    if (
$extension == "") {
      
$extension $this->extension;
    }
    if (!
in_array(strtolower($extension), $this->accepted_extensions[$this->image_type])) {
      return 
false;
    }
    else {
      return 
true;
    }
  }

  function 
check_mime_type() {
    if (!isset(
$this->accepted_mime_types[$this->image_type])) {
      return 
true;
    }
    if (!
in_array($this->mime_type$this->accepted_mime_types[$this->image_type])) {
      return 
false;
    }
    else {
      return 
true;
    }
  }

  function 
set_allowed_filetypes() {
    global 
$config;
    
//Thumbnails
    
$this->accepted_mime_types['thumb'] = array(
      
"image/jpg",
      
"image/jpeg",
      
"image/pjpeg",
      
"image/gif",
      
"image/x-png"
    
);
    
$this->accepted_extensions['thumb'] = array(
      
"jpg",
      
"jpeg",
      
"gif",
      
"png"
    
);

    
//Media
    
$this->accepted_extensions['media'] = $config['allowed_mediatypes_array'];

    
$mime_type_match = array();
    include(
ROOT_PATH.'includes/upload_definitions.php');

    foreach (
$mime_type_match as $key => $val) {
      if (
in_array($key$this->accepted_extensions['media'])) {
        if (
is_array($val)) {
          foreach (
$val as $key2 => $val2) {
            
$this->accepted_mime_types['media'][] = $val2;
          }
        }
        else {
          
$this->accepted_mime_types['media'][] = $val;
        }
      }
    }
  }

  function 
get_upload_errors() {
    if (empty(
$this->upload_errors[$this->file_name])) {
      return 
"";
    }
    
$error_msg "";
    foreach (
$this->upload_errors[$this->file_name] as $msg) {
      
$error_msg .= "<b>".$this->file_name.":</b> ".$msg."<br />";
    }
    return 
$error_msg;
  }

  function 
set_error($error_msg) {
    
$this->upload_errors[$this->file_name][] = $error_msg;
  }
//end of class
?>


and modified part of my MEMBER.PHP file

Code: [Select]

          if (create_thumbnail($src, $dest, $quality, $dimension, $resize_type)) {
            $new_thumb_name = $new_name;
          }
        }
      }
    }
//--------------------------------------------
//--------- Auto Image Resizing --------------
//--------------------------------------------
                  if ($config['auto_image'] && !$uploaderror) {
                     if ($direct_upload) {
                        $src = MEDIA_PATH."/".$cat_id."/".$new_name;
                    }
                    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');
                        }
                  if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
                       $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, $config['max_image_height'])) {
                           $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name;
                                 $uploaderror = 1;
                          }
                           }
                        }
                     }
                  }
//-------------------------------------------
    if (!$uploaderror) {
      $additional_field_sql = "";
      $additional_value_sql = "";




Please, help.
It seems that this MOD work for me as administrator, but not for regular users. Maybe I have to check some permissions?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: IWS_steffen on April 23, 2008, 11:57:04 PM
Hallo,

ich habe den MOD installiert. Er klappt soweit super.
Die Bilder werden automatisch verkleinert. Allerdings nur wenn ich mich als Administrator einlogge. Als Registrieter User wird das Bild leider nicht automatisch verkleinert.

Stimmt eine Einstelung bei mir nicht?

Gruß Steffen
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: kai on April 27, 2008, 12:12:01 AM
A video tutorial for this mod can be found here:
http://www.asian-lady.org/tutors/resize-mod/resize-mod.html
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: alphavto 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: shadowhunter 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Rembrandt 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: shadowhunter 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Rembrandt 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Warrior 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.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Warrior 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.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: shadowhunter 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: rockboy_62 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!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: tucano 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 :-)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: OtusDesign 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: LunaPark 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.

Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: scotlenky 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 (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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: herb 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mentrid on September 12, 2008, 11:20:13 AM
I tried this mod in combination with
http://www.4homepages.de/forum/index.php?topic=20496.0 (http://www.4homepages.de/forum/index.php?topic=20496.0)
and it works just great on version 1.76.

If you use this mod http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313 (http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313)
to upload the big images into a seperate folder you should consider making this update, too:


admin/images.php
Search for:
Code: [Select]
if (@unlink(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file'])) {
Replace with:
Code: [Select]
if (@unlink(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file']) &&
            @unlink(MEDIA_PATH."/".$image_row['cat_id']."/big/".$image_row['image_media_file'])) {

This will also delete the big image from your server when you delete an image in the ACP.
Else you just delete the small file.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on September 12, 2008, 11:46:57 AM
I tried this mod in combination with
http://www.4homepages.de/forum/index.php?topic=20496.0 (http://www.4homepages.de/forum/index.php?topic=20496.0)
and it works just great on version 1.7.6

... thanks for your statement ... ;)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: born2die4ever on September 25, 2008, 12:39:45 AM
I tried this mod in combination with
http://www.4homepages.de/forum/index.php?topic=20496.0 (http://www.4homepages.de/forum/index.php?topic=20496.0)
and it works just great on version 1.7.6

... thanks for your statement ... ;)

Hmmm......
schon komisch..
Ich verstehe immer noch nicht, wie die meisten es geschafft haben, diesen Mod auf 1.7.6 zu installieren...

Ich hab ein frisch installiertes 1.7.6  und ich finde weder den Inhalt der member.php noch
ist die /includes/upload.php geschweige denn die anderen Sachen auf meinem Server vorhanden :(

Ich weiß zwar, das es nur fuer die 1.7 - 1.7.4 Versionen geschrieben ist, aber dann versteh ich nicht, wie einige es geschafft
haben, auf 1.7.6 zu updaten....



Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on September 25, 2008, 12:57:23 AM
Hello and welcome to 4images forum.

I just checked on v1.7.6 and found each string from each step without problem.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: alekinna on October 07, 2008, 04:27:52 AM
Hi all,
One more great and usefull mod. Work perfect!!

I had only one problem:
If images_validate=true, images was resaized but no 'big' folder was created and original file not saved.

So I did some manipulations:
in file member.php find
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;
}

replace with:
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;
$src_copy = MEDIA_TEMP_PATH."/big";
}

in file admin/admin_functions.php find:
Code: [Select]
function copy_thumbnail($image_media_file, $image_thumb_file, $from_cat = 0, $to_cat = 0) {
Insert above:
Code: [Select]
function copy_big($image_media_file, $image_big_file, $from_cat = 0, $to_cat = 0) {
if (is_remote($image_big_file)) {
return $image_big_file
}
$image_src_big = (($from_cat != -1) ? MEDIA_PATH.(($from_cat != 0) ? "/".$from_cat : "") : MEDIA_TEMP_PATH)."/big";
$image_dest_big = (($to_cat != -1) ? MEDIA_PATH.(($to_cat != 0) ? "/".$to_cat : "") : MEDIA_TEMP_PATH)."/big";
$image_src_file_big = $image_src_big."/".$image_media_file;
if ($image_big_file != "" && file_exists($image_src_big."/".$image_big_file)) {
if (!@is_dir($image_dest_big)) {
$oldumask = umask(0);
$result = @mkdir($image_dest_big);
umask($oldumask);
if (!@is_dir($image_dest_big) || !$result) {
@mkdir($image_dest_big, CHMOD_DIRS);
}
}
$big_extension = get_file_extension($image_big_file);
$new_big = get_file_name($image_media_file).".".$big_extension;
if (file_exists($image_dest_big."/".$new_big)) {
unlink($image_dest_big."/".$new_big);
}
$ok = copy($image_src_big."/".$image_big_file, $image_dest_big."/".$new_big);
if ($ok) {
@unlink($image_src_file_big);
@chmod($image_dest_big."/".$new_big, CHMOD_FILES);
$image_big_file = $new_big;
}
if (!file_exists($image_dest_big."/".$new_big)) {
if (!copy($image_src_file_big, $image_dest_big."/".$new_big)) {
$error_log[] = sprintf($lang['copy_file_error_perm'], $image_src_file_big, $image_dest_big."/".$new_big);
}
}
}
return $image_big_file;
}

In file admin/validateimages/php find:
Code: [Select]
$old_thumb_path = THUMB_TEMP_PATH."/".$image_thumb_file;
Insert below:
Code: [Select]
if (file_exists( MEDIA_TEMP_PATH."/big/".$image_media_file ) ) { //  Проверяем есть ли ориг. файл
$image_big_file = addslashes($image_cache[$key]['image_media_file']);
$old_big_path = MEDIA_TEMP_PATH."/big/".$image_big_file;
}

Find:
Code: [Select]
$new_thumb_name = copy_thumbnail($new_name, $image_thumb_file, "-1", $cat_id);
Insert below:
Code: [Select]
if ($old_big_path) {
$new_big_name = copy_big($new_name, $image_big_file, "-1", $cat_id);
}

Find:
Code: [Select]
@unlink($old_thumb_path);
Insert below:
Code: [Select]
if ($old_big_path) {
@unlink($old_big_path);
}


May be it's not right way to solve this problem, but it's work for me.

V@no, thank you for this mod!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: rubberduck on October 09, 2008, 01:39:14 PM
admin/images.php
Search for:
Code: [Select]
if (@unlink(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file'])) {
Replace with:
Code: [Select]
if (@unlink(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file']) &&
            @unlink(MEDIA_PATH."/".$image_row['cat_id']."/big/".$image_row['image_media_file'])) {

This will also delete the big image from your server when you delete an image in the ACP.
Else you just delete the small file.

Könnt Ihr vieleicht das obige an diesen Post

http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313

mit dranhängen? Erspart ne Menge Zeit beim Suchen und man würde es dann auch über das TUT vom Mawenzi gleich finden.

Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: deadlydozen on October 11, 2008, 06:41:46 PM
Hallo,

gibt es eine Möglichkeit das bei dem "Auto copy original file to /big/ folder" Modifikation alle Bilder in den big Folder gespeichert werden ?

Die Modifikation klappt so weit ganz gut. Bis auf eine Sache. Ich habe im ACP das Format 600 * 450 px gewählt.

Wird jetzt vom User ein Bild 1024 * 768 hoch geladen wird es ja auch 600 * 450 verkleinert und in dem media/1 Ordner gespeichert. Das 1024 * 768 wird im Big Ordner abgelegt.

Lade ich jetzt aber ein 400 * 300 px  Bild hoch wird es nur im media/1 Ordner gespeichert und nicht im Big Ordner.

Gibt es eine Möglichkeit das jedes Bild in den Big Ordner geladen wird, unabhängig davon ob es verkleinert wurde oder nicht ?

lg
Michael
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: External on October 28, 2008, 12:22:46 PM
I must be blind, but i dont see any "resized image width field in admin...i see only following options:

Auto-resize image  Yes    No

Auto-resize image quality

Auto-create thumbnail Yes    No

Thumbnail size in pixel

Where do I set the resized width to i.g. 732 pixels?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on October 28, 2008, 01:35:22 PM
It is under "Upload settings" category:

Max. image width in pixel
   
Max. image heigth in pixel
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: webtrade on November 30, 2008, 10:15:49 AM
Hi,

Just wanted to check if this post is still valid and if it's required for 1.7.6 and if it's the the best and easiest way to automatically resize photos upon upload? Also I'm unable to download the file mentioned in step 5. Does it still exist?

Hope someone can help?

Cheers



http://www.4homepages.de/forum/index.php?topic=7700.0
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Nicky on November 30, 2008, 11:23:32 AM
hi and welcome to the 4images forum,

post is still valid ;)

try this download link: http://www.4homepages.de/forum/index.php?action=dlattach;topic=7700.0;attach=874 (attached in the 1st post too) due V@no's site do not exist anymore
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on November 30, 2008, 06:26:03 PM
Wrong download link removed.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: webtrade on December 01, 2008, 06:59:25 AM
Thanks Nicky. Much appreciated! :D
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: jaromir on December 05, 2008, 12:34:29 AM
can be deleted!!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on December 05, 2008, 12:46:39 AM
@jaromir

... this MOD resized images during the upload process via upload-form ...
... I think you tested auto resize via ACP, this MOD is not for the ACP ...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: webtrade 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: webtrade 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!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no 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.
      }
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: webtrade 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no 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.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: webtrade 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


Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Blesi 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no 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.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Lucifix 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?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: meier 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.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Fere 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

Title: Re: Need Help Plz
Post by: jigar110 on February 03, 2009, 02:00:36 PM
Hello and welcome to 4images forum.

You'll need [Mod] Auto image resize on upload (http://www.4homepages.de/forum/index.php?topic=7700.msg17274#msg17274)


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.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no 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.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: yesme 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.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on February 06, 2009, 06:39:30 AM
can I see it?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: yesme on February 06, 2009, 08:01:34 AM
Sure! I thought you have an access to see my gallery.

The gallery is at http://www.jumalee.com/gallery1

 :D

p.s Perhaps, need to use the manual technique which using an Admin Auto-Image-Resizer.
p.s.s Help me with your related MOD please, Re: Share User's Image in Comment  (http://www.4homepages.de/forum/index.php?topic=24099.msg131983#msg131983)

Thank you for your response!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on February 06, 2009, 03:00:49 PM
My guess would be you either made a mistake in Step 1 or didn't enable it in the settings.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: yesme on February 06, 2009, 06:46:45 PM
You should see my settings and I think everything is set as suggested. Maybe, you should check.

Go here: (http://img48.imageshack.us/img48/396/settings4imagestj5.th.gif) (http://img48.imageshack.us/img48/396/settings4imagestj5.gif)

I have missed something in the scripts and just now replaced and edited upload.php and member.php as recommended. (Newbie, confused with Insert 'below'/'above') :D

After configured, then I've just discovered that Guest is not allow to upload exceeding size or dimensions limit whereas Registered users have an access to upload exceeding the size and the dimensions limit. Supposed Registered user's image will auto resize during uploading process.

What is my problem here?

Thank you.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on February 07, 2009, 01:45:25 AM
Sorry, I have no idea what could be wrong...double check all steps.
On your screenshot missing the two new settings from this mod, so you missed a step or made a mistake.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: yesme on February 07, 2009, 05:09:54 AM
Hi V@no!

It getting better now. It works! I've missed many step actually.

Thanks alot.

Btw, may I know do you have a MOD about placing user's image thumbnail into comment? I have searched around but didnt find it. mawenzi have told me you have bb-code snippet etcetera? My thread about this issue is http://www.4homepages.de/forum/index.php?topic=24099.msg131983#msg131983

Thanks again!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: yesme on February 09, 2009, 06:54:21 AM
Owh no! I have installed AutoImage Resize but I am not realized that my users cannot upload image when the image size exceeds the limit. BUT admin is able to upload even the image is bigger than the limit and automatically resize? How this not happend to my user?

Please help me guys and gals.

Thank you.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on February 09, 2009, 07:51:32 AM
I still think you didn't do correctly step 2.x...I've tested the mod on fresh 4images v1.7.6 and it worked fine, so it must be something on your end.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: yesme on February 09, 2009, 08:50:49 AM
V@no, you are such a great man. Now, everything is working well. Just now, installed fresh 4images 1.7.6. Thanks for your support.  :D
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: yesme on February 09, 2009, 09:22:32 AM
I'm again. I said working well because on that time I am using admin account that is why the upload successfully even the size of the image exceed the limit. I thought I am using normal account.  :?

Normal user still unable to upload image when the size exceeds the limitation. Perhaps, I need to set the size of the image in KB at very high limit so that normal user will able to upload their images?! Also affected from MOD that I had installed; Annotation, Upload Info(On upload & In detail page) ?

These an error message appeared after trying to upload image exceeds the size limit.
Quote
Error uploading image file:
blue_season-1280x1024.jpg: Image size invalid

Fyi, auto resize is working very well both user groups.

Here are my upload.php scripts at Step 2.x
Code: [Select]
  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->max_size['thumb'] = $config['max_thumb_size'] * 1024;
    $this->max_size['media'] = $config['max_media_size'] * 1024;

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

    $this->set_allowed_filetypes();
  }

  function check_image_size() {
    $this->image_size = @getimagesize($this->upload_file);
    if ($this->auto_image[$this->image_type]) {
       return 1; //auto image is on, don't need check for anything else.
    }

Thank you.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Lunique on February 09, 2009, 07:09:25 PM
@danke mawenzi, werde dies mal einbauen
wie kann ich erreichen, dass das original bild immer gespeichert wird?

hier der original code
http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313

momentan wird es nur gesichert bei einem resize.

ich möchte gerne, dass alle bilder gespeichert werden.
wer kann mir helfen?

i install the auto image resize mod. when you go to the post above,    
write vano a additive, that picture before resize save to special folder.
as I can save all pictures (also these, the not resized become)

gruss ivan

Thanks for this great mod, everythings working perfect. Only one more question
This has been asked two times before. Is it possible to copy all uploaded images to "big" folder no matter if they are getting resized or not?
Would be really great, thanks!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CarstenM on April 09, 2009, 06:32:37 PM
ist bei dem installer das Fix dabei??? und frage 2.... es geht bei mir nicht ich lade 2000*2000px hoch über ftp check bild.... und nichts!!! hab in den einstellungen dann bei max image jeweils 600 600 px eingestellt und auf ja und nichts geht!!!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CarstenM on April 11, 2009, 02:18:54 PM
also hab grad nochmal alles gemacht!!lade ein bild hoch mit 2000px stell max size auf 600 jeweils und lade die dann per ftp hoch und dann check ich sie ein und schau dann ob sie geändert worden sind und was ist nichts!!!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CarstenM on April 14, 2009, 05:12:07 PM
push =( niemand eine Lösung was das sein kann oder warum es nicht geht!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Nicky on April 14, 2009, 08:59:05 PM
Carsten,

zum thema push > http://www.4homepages.de/forum/index.php?topic=3914.0#post_rule8

dieser mod hat nichts mit ftp upload zutun sondern mit dem webbased upload
zu deinen grossen bildern lese mein voriges posting.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: CarstenM on April 14, 2009, 11:03:55 PM
gibts den Mod auch für Ftp???

oder irgendwie eine Variante wie ich das mit Ftp verknüpfen könnte???

Weil die Homepage für eine Eventfotografin ist und da schon ein paar Bilder aufeinmal anstehen?!...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Rembrandt on April 15, 2009, 05:40:33 AM
Hi!
gibts den Mod auch für Ftp???...
sollte dieser mod sein:
http://www.4homepages.de/forum/index.php?topic=7499.msg33712#msg33712

mfg Andi
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: fulod on April 16, 2009, 09:43:40 PM
Hab das hier eingefügt http://www.4homepages.de/forum/index.php?topic=22922.15 , jetzt hab ich das Problem das wenn die Resize Funktion aktiviert ist das dann die IPTC Informationen im Bild gelöscht werden, ohne Resize gehts ohne Probleme.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: crs on May 01, 2009, 01:18:57 AM
Ich hätte mal Fragen zu diesem Mod:

1. Werden die EXIF-Infos nach der Verkleinerung gespeichert, sodass sie weiterhin unter dem Bild als Information angezeigt werden?
2. Werden Bilder, die bereits in der richtigen Größe hochgeladen werden vom "Verkleinerer" verschont?
3. Kann man die Qualität einstellen, in der die Bilder verkleinert werden?

Danke
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: fulod on May 08, 2009, 07:42:09 PM
Hi

Ich wollte nochmal kurz wegen den EXIF bzw. den IPTC Daten nachfragen ob es da eine Möglichkeit gibt diese zu erhalten.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on May 08, 2009, 08:29:02 PM
@ fulod

... das die EXIF - und die IPTC Daten mit der Resize-Funktion verloren gehen, das liegt nicht prinzipiell an dieser Modifikation ...
... es liegt vielmehr an dem serverseitigen Modul (GD Bibliothek), das für die Bild-Scallierfunktion genutzt wird ...
... im Prinzip gibt es 2 Möglichkeiten um die EXIF - und die IPTC-Daten von serverseitig scallierten Bilder zu sichern ...

1. Variante
Über MODs werden diese Daten vor dem Scallieren ausgelesen und dann in eine DB-Erweiterung geschrieben. Von dort können sie dann wieder ausgelesen und z.B. auf der Detailseite präsentiert werden. Die erforderlichen Modifizierungen ...
[MOD] EXIF V.1.7.6 in DB : http://www.4homepages.de/forum/index.php?topic=21017.0
[MOD] EXIF V.1.7.6 Suchfelder Erweiterung : http://www.4homepages.de/forum/index.php?topic=21053.0
[MOD] IPTC V.1.7.6 Suchfelder Erweiterung : http://www.4homepages.de/forum/index.php?topic=21141.0

2. Variante
Die Originalbilder werden mit einem "big"-Folder abgespeichert und von dort aus können dann die EXIF- und IPTC-Daten weiterhin ausgelesen werden. Die erforderlichen Modifizierungen ...
[TUT] One Image - Three sizes : http://www.4homepages.de/forum/index.php?topic=20496.0 incl.
   • [MOD] Auto image resize on upload : http://www.4homepages.de/forum/index.php?topic=7700.0
   • [MOD] Auto copy original file to /big/ folder : http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313
   • [MOD] Alternate directory for download files : http://www.4homepages.de/forum/index.php?topic=7499.msg33712#msg33712
   • [MOD] Show original image in new window by clicking on image : http://www.4homepages.de/forum/index.php?topic=3236.0
Zusätzlich muss hier noch in der functions.php die URL zum Auslesen der EXIF- und IPTC-Daten an den "big"-Folder  angepasst werden.

Ich favorisiere die 2.Variante, da damit auch das Originalbild weiterhin auf der Website zum Anzeigen und Downloaden mit genutzt werden kann und auch keine DB-Erweiterung erforderlich ist. Willst aber auch über die EXIF- und IPTC-Daten suchen, so kommt eigentlich nur die 1.Variante in Frage  ...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: fulod on May 08, 2009, 08:34:28 PM
Ich nutze diesen MOD:


http://www.4homepages.de/forum/index.php?topic=22922.0

unter:

http://gallery.sobotzik.info

Ich habe noch eine kurze Frage, wie wäre es umsetzbar mit dem oben genannten MOD einen MultiUpload zu erstellen.

Salve

Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: gborislav on May 11, 2009, 03:34:13 AM
Hi,

I installed MOD " Auto image resize on upload " works very good .
After this I tried to use this code: "automaticaly copy original file to /big/ folder "

http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313 (http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313)

and the big folder not creating . Maybe someone can help me to solve the problem.
This is a my website: www.odessapearl.com/gallery

Thanks for help.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: harinezumi on June 03, 2009, 09:03:25 PM
Hi!
I have completed the sequence described on page 1, and I get two additional menu items in control panel. But when I change option for "Auto-resize image" from No to Yes and press "Save changes", the option gets back to No again.
My PHP version is 5.2.6, is this MOD supposed to work with it?
Thanks!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on June 04, 2009, 03:09:59 AM
Hello and welcome to 4images forum.

Did you complete Step 5?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: harinezumi on June 04, 2009, 08:56:34 AM
Thank you!
Yes, I have done everything step-by-step =\
And after I click "Save changes" I get a Settings saved notification on the top of the screen, but radiobutton switches back to No.
I have tried both filling "Auto-resize image quality" field and leaving it blank, but the result is the same.
Do you need any additional information about characteristics of my server?
And thanks once again for spending your time trying to help me!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on June 04, 2009, 03:52:12 PM
the only possible reason I could think of is that the database wasn't updated with new needed settings fields.
what you can try to do first is run the installer from step 5 again, this time you should see an error message instead of success, if you see success, then run it again to make sure. (error message is what we are looking for).
if that didn't help, then try update database manually via phpmyadmin by executing this query:
Code: (MySQL query) [Select]
INSERT INTO 4images_settings (setting_name, setting_value) VALUES ('auto_image', '0');
INSERT INTO 4images_settings (setting_name, setting_value) VALUES ('auto_image_quality', '85');
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: harinezumi on June 04, 2009, 04:18:26 PM
Oops... seems like I have not run the installer at all. All I did was adding 1 file and modifying files listed on page 1.
How do I force-run the installer? I have searched the forum, but I do not speak German, so I could miss the instructions.
Thank you!


Done, modified DB manually from phpmyadmin. Thanks a lot!
But anyway, what was the easiest way to run the installer again?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on June 04, 2009, 05:13:13 PM
just like explained in step 5 ;)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: harinezumi on June 04, 2009, 05:35:59 PM
Damn it.  Now I feel dumb  :lol: :lol:
Thanks again for a great MOD!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: BartAfterDark on June 07, 2009, 04:18:40 PM
Has this been integrated into the latest versions of 4images, or do we still need to add this mod?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on June 07, 2009, 04:25:00 PM
No mods being added into default 4images. You'll need install it manually.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: kennedyusa058 on June 19, 2009, 09:37:08 AM
It's really great. I like it very much.  :D


pret auto (http://pret-auto.org)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Sebas Bonito on June 19, 2009, 10:59:19 AM
Working on v1.7 - v1.7.6
I guess it's also compatible to 1.7.7, but I'd like to be sure  :wink:
Update: It works.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Sebas Bonito on June 23, 2009, 07:23:16 PM
I'd like to use the MOD "Multi Size Download of same image (http://www.4homepages.de/forum/index.php?topic=22741.0)", but the "auto image resizer" won't save the original one in subfolder "big" of each category. How to go on?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on June 23, 2009, 07:44:42 PM
@ Schnick_und_Schnack

... nicht ganz richtig deine Aussage, da offensichtlich nicht alles gelesen hier ...
... Auto copy original file to /big/ folder by resize on upload : http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313 ...
...
... und alles noch mal im Zusammenhang findest du auch hier : http://www.4homepages.de/forum/index.php?topic=20496.0 ...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Sebas Bonito on June 23, 2009, 07:55:43 PM
@ Schnick_und_Schnack

... nicht ganz richtig deine Aussage, da offensichtlich nicht alles gelesen hier ...
... Auto copy original file to /big/ folder by resize on upload : http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313 ...
...
... und alles noch mal im Zusammenhang findest du auch hier : http://www.4homepages.de/forum/index.php?topic=20496.0 ...
Stimmt, die 28 Seiten hab ich nicht gelsen. Aber herzlichen Dank für die Zusammenstellung, jetzt hab ich's auch gecheckt  :wink:

UPDATE:
I made the update to save the original file in the "big"-folder (like here (http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313) was descripted), but nothing happened. The normal Upload works (inkl. the autoresizer), but the original BIG file won't be saved in the folder. I checked the folder of its category, but CHMOD is 777, and I've seen no server-error-logs. I also deleted the big folder... after I uploaded the new filed a new BIG-folder was created, but without the original file within.


UPDATE 2:
Okay, I've thought there weren't any errors... but take a look:
Quote
[Tue Jun 23 23:49:12 2009] [error] [client XYZ] PHP Warning: copy() [<a href='function.copy'>function.copy</a>]: SAFE MODE Restriction in effect. The script whose uid is 10022 is not allowed to access /srv/www/vhosts/XYZ.de/httpdocs/XYZ/data/media/11/big owned by uid 30 in /srv/www/vhosts/XYZ.de/httpdocs/XYZ/member.php on line 670, referer: http://www.XYZ.de/XYZ/member.php?action=uploadform
[Tue Jun 23 23:49:12 2009] [error] [client XYZ] PHP Warning: copy(./data/media/11/big/Rockbr_Postkarten4.jpg) [<a href='function.copy'>function.copy</a>]: failed to open stream: No such file or directory in /srv/www/vhosts/XYZ.de/httpdocs/XYZ/member.php on line 670, referer: http://www.XYZ.de/XYZ/member.php?action=uploadform
Okay, so the SAFE MODE is the problem.
Title: Re: [Mod] Auto image resize on upload.
Post by: shane on July 08, 2009, 09:26:25 AM
Very good idea, V@no! According to my experience, just 10% of users have some idea how to resize their images, so if they're trying to upload oversized photos, and gallery doesn't accept it, they just give up...

Very true, Great mod v@no
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Sebas Bonito on July 08, 2009, 10:44:08 AM
Nobody an idea, why the copy into the big-folder doesn't work  :?:  :oops: [see post #415]
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: rinaldos on July 08, 2009, 11:36:50 AM
Maybe you have an error inserting the code .... Without any codes is it impossible to find out, why this doesn't work for you .....

Gruß
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: waynenort on August 01, 2009, 06:53:42 AM
Did all the steps - downloaded the install_autoimage.php
and ran it from the IE  after I did all the changes in the mod and I keep getting this error " An unexpected error occured. Please try again later.
". Please see the screen capture. Went thorugh all the steps again, just incase I missed something and the same thing happens.
any ideas to why?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on August 01, 2009, 09:39:35 AM
Second time might give you errors, because the database already updated. Check if mod works by changing "Auto-resize image" and "Auto-resize image quality" settings
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: waynenort on August 01, 2009, 10:39:47 AM
Strange.... Because this also happened this first time I installed it on a test sight before putting it on the public sight (different datebase). Figured this first time it went wrong on the because I was fooling around with the complete gallery structure and images ended up all pixellated when resized. This time around it the resizer works fine even though it gave that error. Thought I only hit the install once, but must have done it a second time.
Thanks mate.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Sebas Bonito on August 01, 2009, 06:09:41 PM
Maybe you have an error inserting the code .... Without any codes is it impossible to find out, why this doesn't work for you .....
Gruß
No, it had to do with the "safe mode... now it's off and everything works fine.  :)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Boltning on August 03, 2009, 03:58:59 PM
Hello 4 images - its a very nice app.
Installed the gallery and all worked great.
Played with teh structure and added your Mod. Auto image resize.
Must of deleted something I shouldn't because I don't get the loading square with the arrow wehn uploading images. And the Max. image size in KB in admin doesn't work now. I can upload any size image no matter what its set on.
Wahts ment to run the loading square and where can it be found? I guess thats my issue.

tks


 
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on August 03, 2009, 04:32:15 PM
Hello and welcome to 4images forum.

I'm not quiet sure what square you are talking about...
As of image sizes - admins don't have any restrictions, other then image types.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Mariuz 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: rinaldos 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Mariuz on August 06, 2009, 11:14:56 PM
Okay dank dir ich werde es mal testen :)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: DarkM 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)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: kmcled 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: kmcled 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!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Blesi 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Blesi 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
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Sebas Bonito 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;
                   }
                      }
                     }
                  }
//-------------------------------------------
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: k1lljoy 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 (http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313) 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)  :)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Sebas Bonito on December 18, 2009, 07:55:48 PM
Please, I really need help in this:  :oops:

http://www.4homepages.de/forum/index.php?topic=7700.msg143455#msg143455
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: k1lljoy 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?  :?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on February 17, 2010, 06:35:00 AM
Did you do Step 8?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: k1lljoy 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  :)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Sunny C. on March 15, 2010, 09:18:03 PM
Fine Modifikation.
But a Feature ist los. Upload in ACP with resize and Full size saved in big!!
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on March 15, 2010, 11:02:49 PM
... auch das Feature ist noch da, nur du hast nicht geschafft bis auf Seite 3 weiterzulesen ... ;)
... hier gibt es das BIG-Feature ... http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313 ...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Sunny C. on March 15, 2010, 11:14:39 PM
Aber das wird ja in der member.php verbaut. Demnach wird doch über das ACP nichts in einem big Ordner gespeichert!

Ich habe sowieso mal ein paar Fragen zu dem "Auto-Image-Resizer"
Beispiel:
(http://s6b.directupload.net/images/100315/hssfatb6.png)

Wie man sieht, will ich die Größe: 426x300 vergeben, aber dabei kommt immer was anderes heraus. Habe extra [FIX] Max height has no affect when do image resize (http://www.4homepages.de/forum/index.php?topic=7058.0) installiert, aber trotzdem funktioniert das nicht. Ob ich feste Breite oder Feste Höhe angebe. Es wird trotzdem Proportional verkleinert.

Gibt es keine Möglichkeit eine Feste Breite und Höhe anzugeben? Ich habe die Thumbnails und die Detailsbilder als Hintergrundbild. Da man via CSS die Hintergrundbilder nicht auf einer Größe reduzieren kann bin ich gezwungen, die Bilder halt mit einem Rezizer anzupassen. Ich möchte aber nicht jedes Bild/Thumbnail auf dem Computer die richtige Größe zu verpassen.

Kann man irgendwo die Rezizegröße im Code für die Bilder und den Thumbnails direkt eintragen, so das sich das auch nicht mehr ändert? Auch wenn die Ato Rezize on Upload installiert habe funktioniert das nicht. Es wird bei mir sowieso kein Big Ordner angelegt, davon mal abgesehen.

Über das ACP einen Punkt mit "Rezizer" und die Optionen Thumbnailer und Bilder eine DIREKTE Größe zu verpassen wäre mehr als wünschenswert. Allerdings weis ich nicht wie das funktioniert sonst hätte ich schon was gebastelt. Und am liebsten würde ich das ganze auf Englisch formulieren, weil ich denke das V@no mit Sicherheit dafür eine Idee hätte.

Ich möchte quasi Bilder einer X-Beliebigen Größe via ACP hochladen können, sowohl das Bild als auch das Thumbnail. Durch den Klick auf "Resizer" kann man dann für Thumbnails und den Bilder eine feste Größe angeben und auf "Resize" klicken oderso.

Das wäre sowas von perfekt!!!

LG
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on March 16, 2010, 12:16:29 AM
There are not many people would actually want distort a picture, that's why 4images resizes images proportionally.
here is example how your screenshot would look like if width is the same as height:
(http://img40.imageshack.us/img40/4666/hssfatb6.png)

is this what you want?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Sebas Bonito on March 16, 2010, 12:19:23 AM
Sorry for repeat myself, but so far nobody has reacted to my question:

How to decrease or change the file-size/-resolution of the pictures in the BIG-folder during the upload-process?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Sunny C. on March 16, 2010, 10:35:40 AM
There are not many people would actually want distort a picture, that's why 4images resizes images proportionally.
here is example how your screenshot would look like if width is the same as height:
(http://img40.imageshack.us/img40/4666/hssfatb6.png)

is this what you want?

Hallo Vano, dass ist ja in den meisten Fällen auch gut so. Ich verwende auf meiner Seite Covers. Die Thumbnails haben dort eine Größe von 115x81 und die Bilder 426x300. Die Bilder und die Thumbnails werden als Hintergrundgrafiken ausgegeben. Über den Grafiken liegt eine andere Grafik. Darum möchte ich die Möglichkeit haben den Bildern eine feste Größe zu verpassen welche nicht Proportional ist.

Ein Plugin würde reichen. Ich werde mich an so einem Plugin selber versuchen. Ein Plugin wäre in diesem Fall am sinnvollsten da nicht jeder solch eine Erweiterung gebrauchen kann.

Google Translate
Hi Vano, that yes, in most cases a good thing. I use covers on my side. The thumbnails are there a size of 115x81 and images 426x300. The images and the thumbnails are displayed as background graphics. About the charts is another graphic. Therefore I would like to have the opportunity to miss the pictures has a fixed size which is not proportional.

A plugin would be enough. I'll try my hand at such a plugin myself. A plugin would in this case could use the most sense because not every such an extension.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: jaheba on April 16, 2010, 09:08:46 AM
Is this mod working in ver 1.7.7 ?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: 2snaps on May 01, 2010, 01:39:38 PM
-> jaheba

Yes It works fine in version 1.7.7  :D
Title: Re: [Mod] Auto image resize on upload.
Post by: Guldstrand on May 28, 2010, 02:13:49 PM
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 (http://www.4homepages.de/forum/index.php?topic=3236.0).
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:
Maybe a stupid question, but where am i supposed to add this code?
Shall i change the code in member.php (from the first post), to this one?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: mawenzi on May 28, 2010, 02:33:39 PM
@ Guldstrand

... yes ... in member.php ...

1. http://www.4homepages.de/forum/index.php?topic=7700.0
2. http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Guldstrand on June 02, 2010, 02:06:58 AM
How to use this mod with the Auto-Image-Resizer in admin?
I´ve already over 3000 images in my gallery, and i want to auto create intermediate images for them to.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on June 02, 2010, 02:23:29 AM
Try this mod: [MOD] Batch Copy/Move/Edit Images v4.14.1 (2008-12-30) (http://www.4homepages.de/forum/index.php?topic=6759.0)
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Carpfish on June 15, 2010, 08:32:08 AM
Habe auch diesen Mod in verwendung und Funktioniert echt super...Thanks V@no
Zusätzlich habe ich noch den Highslide dazu.

Nur habe ein Problem, ich habe auch den Media Site´s Mode http://www.4homepages.de/forum/index.php?topic=24054.0 (http://www.4homepages.de/forum/index.php?topic=24054.0) von V@no instaliert.
Ich bekomme zwar das Thumb, aber in der Detailseite sehe ich nichts.
Hat dies mit dem Images Resize Mode zu tun?
Vieleich kann mir wer helfen, habe im Moment ein zweites 4images mit Videos auf einer anderen Datenbank laufen, möchte es aber in der Bildergallery verwenden.

Thanks Andy
Title: Re: [Mod] Auto image resize on upload.
Post by: Sebas Bonito on July 02, 2010, 04:14:04 PM
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 (http://www.4homepages.de/forum/index.php?topic=3236.0).
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:

I still do need help to resize also the big/original-file. In my gallery some pictures are 7 Megabyte (!), too much :-) So I've resized all my big-images by an php-image-resizer (http://www.kick-image.at/webdesign-webtools.html?chapter=image-resizer#image-resizer) to a max-height or max-width of 1600px and a jpg-quality of 75. This took many hours!

I'd like to have this function in 4images for the original-image, before it will be copied in to the big-folder.

So please, I do hope, somecone could help me out...
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: Lucifix on October 02, 2010, 10:23:54 AM
Does anyone know if EXIF info will be lost if image will be auto resized? I tested this on my site and EXIF is gone. Anyone know how to fix that?
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on October 02, 2010, 06:41:28 PM
use ImageMagick
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: haider512 on December 07, 2010, 07:24:43 AM
Hi..is it only for resizing images or it also auto resize the thumbnails..

Please reply..looking forward to it..

Regards
Haider.
Title: Re: [Mod] Auto image resize on upload. (updated 19/09/04)
Post by: V@no on December 08, 2010, 01:33:20 AM
It's only for images, not thumbnails.
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: V@no on December 12, 2010, 09:00:23 PM
Step 1
In new version 2 added thumbnails resize.
To upgrade do the following:

Open member.php find:
//--- End Auto Image Resizing ----------------

Insert above:above::
    if ($config['auto_thumbnail'] && !$uploaderror)
    {
      if ($direct_upload)
      {
        $src = THUMB_PATH."/".$cat_id."/".$new_name;
      }
      else
      {
        $src = THUMB_TEMP_PATH."/".$new_name;
      }
      $do_resize = 0;
      if ($image_info = @getimagesize($src))
      {
        if ($image_info[2] > 0 && $image_info[2] < 4 && $image_info[0] > $config['max_thumb_width'] || $image_info[1] > $config['max_thumb_height'])
        {
          if (!function_exists("init_convert_options"))
          {
            require(ROOT_PATH.'includes/image_utils.php');
          }
          $convert_options = init_convert_options();
          if (!$convert_options['convert_error'])
          {
            $quality = intval($config['auto_image_quality']);
            $quality = ($quality >= 0 && $quality <= 100) ? $quality : 85;
            if (!resize_image($src, $quality, $config['max_thumb_width'], 1, $config['max_thumb_height']))
            {
              $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name;
              $uploaderror = 1;
            }
          }
        }
      }
    }

Step 2
Open includes/upload.php

Find:
    $this->auto_image['media'] = $config['auto_image'];

Insert below:below::
    $this->auto_image['thumb'] = $config['auto_thumbnail'];
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: haider512 on December 12, 2010, 11:23:51 PM
can you please also add one more feature in to it ...that it also auto resize the Avatar too to the defined width and height in ACP??
it will b a great feature..scince then users wont gonna need PhotoShop, or image resizer software to auto resize image and upload it ..

now if user upload avatar bigger then the size difined in ACP..it gives error..but i guess auto resize in avatar will be really great feature..
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: x23piracy on December 13, 2010, 09:08:31 AM
Hi,

is it possible to let me choose if width or height is taken for resizing?
If the resizing is made by width the height may differs to the other pictures,
that brings a bad look für categorie view for me.
(thumbs not on a line, different height).

So for me it would be better if the resizing can be made by max height given in ACP.
Could that be an option?

Another way should be to resize for given max width and then another resize to
max height by holding proportion.

I think the best solution is to choose a setting for that:

- resize by max width given by acp
- resize by max height given by acp
- resize by max width, then by max height given by acp


Greetz X23
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: V@no on December 13, 2010, 02:44:51 PM
so what happens when you set max widht/height to the same value?
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: haider512 on December 15, 2010, 11:59:29 AM
My image auto resize is not working..
Yes thumbanail is auto resizing but how to make it working for auto resize the image??

it gives me error when i upload image of bigger then the size defined in the ACP??

Code: [Select]
Error uploading image file:
db_systems.jpg: Image width invalid
db_systems.jpg: Image heigth invalid

shouldn't it is suppose to auto resize?? or we have to some changes in ACP to make it auto resizable?


you can see in the attached screen shot..

please reply how to make it autoresizable?


=================================================

ok. i found a new thing..i mean..when i login from my admin account..it resize the image..but when i upload image from normal user account..it gives me this problem..i think there is restriction on user that user cant upload size more than the specified size in ACP??

how to fix this problem?
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: V@no on December 15, 2010, 02:13:22 PM
double check step 2.2, it's below, not above ;)

P.S.
just updated the instructions, replaced $ok with "1", shouldn't matter above or below anymore.
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: haider512 on December 15, 2010, 02:28:53 PM
double check step 2.2, it's below, not above ;)

P.S.
just updated the instructions, replaced $ok with "1", shouldn't matter above or below anymore.

hi..

thanks again for reply..
should i do check the step 2.2 or should i replace $ok.. if i do replace the $ok with 1 then i wont have to check the step 2.2 right??


====================


ok it was already below..but i changed it from "return $ok;to "return 1;"..but no use??

still im having the size problem..the auto resize not working for normal users..??

This is some of coding i changed in upload.php..

Code: [Select]
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();
  }

  function check_image_size() {
    $this->image_size = @getimagesize($this->upload_file);
    $ok = 1;

    if ($this->auto_image[$this->image_type]) {
      return 1; //auto image is on, don't need check for anything else.
    }

    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;
  }
Title: Need Help with Auto Image resize on upload mod
Post by: haider512 on December 17, 2010, 02:43:49 AM
Hi i need help..i cant figure out that how to fix the problem..i also did posted in the respective mod topic but still issue is not solved yet..so will appreciate anyone help me out..

Actually it is a great mod..infact awesome one..and im very happy to have this mod..and this mod is working fine but for the admin (me).
it auto resize image and thumbnails both if i do it from admin account..

but from normal regular user account when i try to upload a image it gives me error of that image and height is invalid the the image is bigger then the resolution that i have set in admin..

now instead it should b doing auto resizing..it should not giving me problem of image height and width..it should auto resize the image to the defined size and height in ACP...

it works for admin for not for user..

here is the post i have already asked for help..
http://www.4homepages.de/forum/index.php?topic=7700.msg154211#msg154211

it is really great mod...and i do really love to have this mod..


Please any one fix this issue/bug for me..

Looking forward to your help..please..
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: V@no on December 17, 2010, 04:02:01 AM
and did you enable auto resize in the config?
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: haider512 on December 17, 2010, 02:41:22 PM
and did you enable auto resize in the config?

i dont know may be its enabled..please tell me where in ACP to enable it..

this is settings screenshot in ACP...
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: henary on December 17, 2010, 02:55:50 PM
Hello,

i think you did't do step 4  :wink:

Regards,
Henry
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: haider512 on December 17, 2010, 05:40:21 PM
Hello,

i think you did't do step 4  :wink:

Regards,
Henry

Thanks.. for letting me know..yes i fixed it now..and you can see in the thumbnail now..i did the step 4..

but still that restriction problem isn't solved..im still having that problem..and image resize is enabled..


please reply how to fix this problem..please please..looking forward to your replies.....

Best Regards
Haider.


==================================

i think it has something to do with this coding but i am not sure now..


Code: [Select]
function check_image_size() {
    $this->image_size = @getimagesize($this->upload_file);
    $ok = 1;

    if ($this->auto_image[$this->image_type]) {
      return 1; //auto image is on, don't need check for anything else.
    }

    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;
  }

 im stucked in coding.. all i know to remove coding so it should not check size and width lolz..but still dont know will it gonna work or not..

any how.. please reply... im stucked up in these codings..


=========================================================


wow i just figured out one more thing..your mod is doing great regarding to resizing images..
i mean when regular users upload images bigger then the sized defined in admin then it resize them..

but its the thumbnail which is giving error to regular users regarding to size and height..

and the step 2.2 ...i guess its for image resizing not for thumbnail resizing..
i think you should make some more changes in your coding for thumbnails too so users dont get problem when they upload thumbnails bigger then the size defined in admin section..

rest you mod is doing great..and its awesome mod..

as you have inserted auto thumbnail resize feature later..so i guess you forgot to add the code for thumbnail that it should not give error when trying to upload bigger image then defined and it should auto resize it..


Please loook in to this matter and im still looking forward to help...

please..
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: V@no 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 (http://www.4homepages.de/forum/index.php?topic=7700.msg154092#msg154092) steps to update
Title: Re: [Mod] Auto image resize on upload v2.0 (2010-12-12)
Post by: haider512 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 (http://www.4homepages.de/forum/index.php?topic=7700.msg154092#msg154092) 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??
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: V@no 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
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: haider512 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..
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: haider512 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..
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: Warrior 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.
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: mmarschner 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
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: k12onos 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?
Title: Re: [Mod] Auto image resize on upload.
Post by: clubbu 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 (http://www.4homepages.de/forum/index.php?topic=3236.0).
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?
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: kimchu 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
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: stevie69 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.
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: V@no on March 06, 2012, 03:16:05 AM
Welcome to 4images forum.

Try [MOD] Batch Copy/Move/Edit Images v4.15.7 (2011-01-09) (http://www.4homepages.de/forum/index.php?topic=6759.0)
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: stevie69 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.
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: MrAndrew 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!
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: kicks 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!
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: Warrior on April 13, 2013, 04:55:25 AM
kicks, it works with 1.7.11.

It's also best used with a couple of other things that can be seen here- http://www.4homepages.de/forum/index.php?topic=20496.0

stevie69, V@no pointed you to that other thread because that MOD does what you're asking. You need to add/install it. See this page - http://www.4homepages.de/forum/index.php?topic=6759.255
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: bayer on June 18, 2013, 03:11:34 PM
in der version 1.7.11 funktioniert das nicht. gibt es eine andere möglichkeit bilder beim hochladen automatisch auf die max. höhe/breite zu skalieren die in der admin umgebung definiert sind?
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: Greven-Freunde on July 31, 2013, 07:19:55 AM
in der version 1.7.11 funktioniert das nicht. gibt es eine andere möglichkeit bilder beim hochladen automatisch auf die max. höhe/breite zu skalieren die in der admin umgebung definiert sind?
Habs gerade in die 1.7.11 eingebaut...funktioniert einwandfrei bis auf den Verlust der Exif-Daten
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: MorYeL on March 26, 2015, 10:32:40 AM
Hi to all.

I upload the mod http://www.4homepages.de/forum/index.php?topic=7700.0 . Everything is ok for admin uploads but there is a problem about registered users (members) upload. There is no problem on resizing while uploading by admin. I read forums but I couldn't find help about this.

But when users (members) upload the same image (same size, same width, same height) they getting this error:
Code: [Select]
Error uploading thumbnail file:
img----img.jpg: Image size invalid

There is a problem about registered users (members) upload resizing. How can I solve this? Please help me.

Sizes of trying to upload image and thumb

Code: [Select]
Size: 341 kb, width:1280 , height:960

My upload settings on admin panel:

Code: [Select]
Upload mode : Save files with new name

Valid file extensions: jpg, gif, png.

Max. width of thumbnail in pixel : 140

Max. heigth of thumbnail in pixel :140

Max. thumbnail size in KB: 100

Max. image width in pixel: 770

Max. image heigth in pixel: 770

Max. image size in KB: 2000

Notify by email upon user upload: yes

Additional email addresses for notification: ------
Delimit emails by comma.

Auto-create thumbnail: Yes

Thumbnail size in pixel: 100

Proportions: Resize proportionally

Thumbnail quality: 75
0 to 100
Title: Re: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)
Post by: Jasi on August 09, 2015, 11:06:51 PM
@ ALL

Löscht man Bilder werden dir Originalbildfiles im Ordner /big nicht mit gelöscht!

Wer hat eine Lösung dass auch die Originalbildfiles im Ordner date/media/xxxx/big mit gelöscht werden?

Danke schon mal für die Hilfe :-)