• [Mod] Auto image resize on upload v2.0.1 (2010-12-18) 4 0 5 1
Currently:  

Author Topic: [Mod] Auto image resize on upload v2.0.1 (2010-12-18)  (Read 588247 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Auto image resize on upload.
« Reply #60 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!
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline beachgerl

  • Newbie
  • *
  • Posts: 14
    • View Profile
[Mod] Auto image resize on upload.
« Reply #61 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! :)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Auto image resize on upload.
« Reply #62 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
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline beachgerl

  • Newbie
  • *
  • Posts: 14
    • View Profile
[Mod] Auto image resize on upload.
« Reply #63 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. :)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Auto image resize on upload.
« Reply #64 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();
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline beachgerl

  • Newbie
  • *
  • Posts: 14
    • View Profile
[Mod] Auto image resize on upload.
« Reply #65 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

Offline reson

  • Pre-Newbie
  • Posts: 3
    • View Profile
[Mod] Auto image resize on upload.
« Reply #66 on: June 11, 2003, 05:35:32 PM »
i can't unpack "Autoimage Install"file.

Offline martinp

  • Pre-Newbie
  • Posts: 6
    • View Profile
    • http://www.popilka.net
Does not work?
« Reply #67 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

Offline Vraxor

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • http://tc-revolution.net
[Mod] Auto image resize on upload.
« Reply #68 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Auto image resize on upload.
« Reply #69 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
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Vraxor

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • http://tc-revolution.net
[Mod] Auto image resize on upload.
« Reply #70 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

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #71 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
As long as I can finish my site before I die.

Offline marchchild

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #72 on: March 21, 2005, 11:53:10 AM »
 :D Auto resizer works like a dream - thanks!

Offline bentleykf

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #73 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Auto image resize on upload. (updated 19/09/04)
« Reply #74 on: March 27, 2005, 06:56:22 PM »
sorry, what is your question again?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)