Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - beachgerl

Pages: [1]
1
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

2
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. :)

3
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! :)

4
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.

5
Mods & Plugins (Releases & Support) / Re-coded the auto image upload
« 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.

6
Anyone who could resolve this? Otherwise, I'd be forced to revert to original gallery scripts.

I'd appreciate it.

Thanks.

7
Mods & Plugins (Releases & Support) / Changed the mod - one error
« 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!

8
Mods & Plugins (Releases & Support) / Line 513
« 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?

9
Mods & Plugins (Releases & Support) / Parse error
« 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?

10
Discussion & Troubleshooting / Have similar problem
« on: May 15, 2003, 11:41:11 AM »
I am facing similar problem you're facing. Only way to resize the thumbnail images is if I do it myself (in Photoshop) before uploading 'em. Users would be forced to resize their own images if they exceed the max. lengths, I tested it myself as a "registered user." It'd be nice if 4homepages would allow automatic resizing of large files as thumbnails to specified sizes set up by the admin. If there's a mod for this, then point me the way!

If I logged in as admin, then the max. lengths don't count because I'm the admin. :oops:

11
I thought I'd use this topic to ask my questions. I've made modifications in Settings. For thumbnails, I made sure that they are:

- 100x100 max (w & h)
- Auto-create thumbnail
- Thumbnail in pixel: 100
- Resize proportionally

Now, I tried to upload an image that is much larger than 100x100 size. It did not automatically reduce the image to 100x100. How do I make this work? So I don't have to resize every image to 100 pixels by myself, but let the gallery automatically resize those images to thumbnail size. I'm not sure what is missing and why it's not working?

Thanks!

Pages: [1]