Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Auto Resize Image Attachments (Avatars & Profile Pic Too).... Details »»
Auto Resize Image Attachments (Avatars & Profile Pic Too)....
Version: 1.00, by mini2 mini2 is offline
Developer Last Online: Oct 2010 Show Printable Version Email this Page

Version: 3.0.6 Rating:
Released: 08-16-2004 Last Update: 11-11-2004 Installs: 73
 
No support by the author.

Gone

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-17-2004, 09:29 AM
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Location: TX
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cool. I like it a lot

working on www.runaked.com/forums
Reply With Quote
  #3  
Old 08-17-2004, 02:10 PM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's awesome - this is something I've been looking for for ages

Question: is it an easy thing to add this feature (maybe make your functionality into a standalone function?) into the Avatar upload and Profile pic upload functions ?
Reply With Quote
  #4  
Old 08-19-2004, 12:49 PM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks muchly! This was the one final hack I was waiting for from my ol' vB2 - I looked into it a couple times, but never had the patience
Reply With Quote
  #5  
Old 08-19-2004, 04:20 PM
Symbian.info Symbian.info is offline
 
Join Date: Nov 2001
Location: Netherlands
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does any one knows if it works in PHP in safe mode??
Reply With Quote
  #6  
Old 08-21-2004, 02:29 PM
MrNase MrNase is offline
 
Join Date: May 2003
Location: Germany
Posts: 670
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed it and I hope it's working

(It's working, thank you so much )
Reply With Quote
  #7  
Old 08-23-2004, 10:37 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very cool and useful hack. A lot of members are clueless when it comes to image resizing. This is a great idea.
Reply With Quote
  #8  
Old 08-24-2004, 10:45 PM
Symbian.info Symbian.info is offline
 
Join Date: Nov 2001
Location: Netherlands
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mini2
Has anyone with PHP in safe mode tried this out yet? I'm keen (as others might be) to know if it works?
Don't think it works :tired: I try it with the File Attachment Images Resize hack, when I upload a big files take a time and then many, many (50x) errors like this:
Warning: Division by zero in /home/website/www/forum/includes/functions_file.php on line 318
Warning: Division by zero in /home/website/www/forum/includes/functions_file.php on line 319
Warning: Division by zero in /home/website/www/forum/includes/functions_file.php on line 327
Warning: Division by zero in /home/website/www/forum/includes/functions_file.php on line 328
Warning: imagecreatetruecolor(): Invalid image dimensions in /home/website/www/forum/includes/functions_file.php on line 331

and then: IMG_0541.JPG:
File Too Large. Limits are 640 x 480. Your file is 1600 x 1200.

So far not working, I don't know if it the safe mode..
Reply With Quote
  #9  
Old 08-31-2004, 12:05 AM
lazytown lazytown is offline
 
Join Date: Feb 2004
Posts: 503
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There seems to be a problem with the avatar upload feature. If I set avatars to no more than 20K, but photos to 150K, it uses the 150K limit for avatars.
Reply With Quote
  #10  
Old 08-31-2004, 12:06 AM
lazytown lazytown is offline
 
Join Date: Feb 2004
Posts: 503
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For files that are too big (in K), I would still like to see it try and resize them -- then see if they come under the file size limit.
Reply With Quote
  #11  
Old 08-31-2004, 05:25 PM
memdy's Avatar
memdy memdy is offline
 
Join Date: Oct 2002
Location: Outside the box
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Getting similar error message, just installed GD 2.0.23

---------- begin error msg --------------------

Warning: Division by zero in /var/www/html/forums/includes/functions_file.php on line 44

Warning: Division by zero in /var/www/html/forums/includes/functions_file.php on line 45

Warning: Division by zero in /var/www/html/forums/includes/functions_file.php on line 53

Warning: Division by zero in /var/www/html/forums/includes/functions_file.php on line 54

Fatal error: imagecreatetruecolor(): requires GD 2.0 or later in /var/www/html/forums/includes/functions_file.php on line 57

----------- end error msg ---------------

-- line 44 -- $width_factor = $w / $maxattachwidth;
-- line 45 -- $height_factor = $h / $maxattachheight;
-- line 53 -- $nw = round($w / $height_factor);
-- line 54 -- $nh = round($h / $height_factor);
-- line 57 -- $ni=imagecreatetruecolor($nw,$nh);
Reply With Quote
  #12  
Old 09-01-2004, 01:25 PM
CVMagic's Avatar
CVMagic CVMagic is offline
 
Join Date: Dec 2002
Location: USA/Connecticut
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The issue with the deviding by zero in this hack is that you overlooked the fact that the hack does not define what $maxattachwidth & $maxattachhieght are... so besure to add those values to be edited in the admin panel....

^_^ by the way I coded the original version of this hack for vB2, look in the beta section for it, it should help you with some of the bugs in this one... FYI: Safemode shouldnt affect this scrpt as long as its not writing on to the filesystem. Also it helps to cache the resized images because trust me doing it on the fly will bog down the system in the long run.
Oh, I almost forgot if you have any questions feel free to send me a PM.
Reply With Quote
  #13  
Old 09-01-2004, 01:38 PM
memdy's Avatar
memdy memdy is offline
 
Join Date: Oct 2002
Location: Outside the box
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.offshoreonly.com/phpinfo.php" target="_blank">http://www.offshoreonly.com/phpinfo.php</a>
Reply With Quote
  #14  
Old 09-01-2004, 01:40 PM
CVMagic's Avatar
CVMagic CVMagic is offline
 
Join Date: Dec 2002
Location: USA/Connecticut
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by memdy
Getting similar error message, just installed GD 2.0.23

---------- begin error msg --------------------

Warning: Division by zero in /var/www/html/forums/includes/functions_file.php on line 44

Warning: Division by zero in /var/www/html/forums/includes/functions_file.php on line 45

Warning: Division by zero in /var/www/html/forums/includes/functions_file.php on line 53

Warning: Division by zero in /var/www/html/forums/includes/functions_file.php on line 54

Fatal error: imagecreatetruecolor(): requires GD 2.0 or later in /var/www/html/forums/includes/functions_file.php on line 57

----------- end error msg ---------------

-- line 44 -- $width_factor = $w / $maxattachwidth;
-- line 45 -- $height_factor = $h / $maxattachheight;
-- line 53 -- $nw = round($w / $height_factor);
-- line 54 -- $nh = round($h / $height_factor);
-- line 57 -- $ni=imagecreatetruecolor($nw,$nh);
Be sure to restart your webserver and besure that php isn't complied with GD into it because then it will not run your newer version of GD... instead recompile PHP making sure that it points to your current version of GD... as far as the other errors they are just values that were overlooked when preparing the hack...

to mini: try to test for GD2 within the script with a function check on imagecreatetruecolor and if it fails then make it use imagecreate instead because it is compatible with all versions of GD so it will 1) make sure that the forum wont have errors in exchange for uglish images and 2) makes your hack compatible with earlier versions of PHP
Reply With Quote
  #15  
Old 09-05-2004, 10:47 PM
Blindchild02's Avatar
Blindchild02 Blindchild02 is offline
 
Join Date: Apr 2002
Location: USA
Posts: 741
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i get this error

Quote:
Fatal error: Call to undefined function: unsharpmask() in /home2/xamira/public_html/forums/includes/functions_upload.php on line 292
Reply With Quote
  #16  
Old 09-05-2004, 11:51 PM
Blindchild02's Avatar
Blindchild02 Blindchild02 is offline
 
Join Date: Apr 2002
Location: USA
Posts: 741
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

alrite, adding require_once('./includes/functions_image.php'); worked
Reply With Quote
  #17  
Old 09-30-2004, 07:23 PM
johnnyb johnnyb is offline
 
Join Date: Dec 2003
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I uploaded everything, and modified everything, but the images aren't resized?
Reply With Quote
  #18  
Old 10-22-2004, 08:31 AM
calvinnguyen calvinnguyen is offline
 
Join Date: Nov 2003
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Designed for: vBulletin 3.0.3 on a Linux server with PHP 4.3.8 and GD 2.0.23. PHP not in safe mode and attachments stored in the database. May work in other cases, but I can't guarantee that.

I had install it, but it didn't work for me.
Reply With Quote
  #19  
Old 10-22-2004, 10:11 AM
calvinnguyen calvinnguyen is offline
 
Join Date: Nov 2003
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mini2
If you have that configuration, it works.

1.Did you get errors, or anything?

2.Do you have your max attachment sizes set in the adminCP to start with?

3.Do you have a php.info file somewhere?
1.
I didn't get anything wrong, but I the size of the photo that attachment is not getting resize.

2. yes I had set the max attachment sizes

3. No, I don't have a php.info file

For set max attachment sizes, if we set it smaller than the photo size, after we attachment to the post , it will be resize to me equal the max attachemt sizes right?
Reply With Quote
  #20  
Old 10-24-2004, 10:16 PM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, there is a vB3 option to allow public viewing of phpinfo()...
Reply With Quote
  #21  
Old 10-31-2004, 06:27 PM
Blam Forumz Blam Forumz is offline
 
Join Date: Jun 2004
Posts: 554
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Didnt work for avatars, everything else i dunno...
Reply With Quote
  #22  
Old 11-11-2004, 04:54 PM
outlaw621's Avatar
outlaw621 outlaw621 is offline
 
Join Date: Oct 2004
Posts: 71
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Using on vBulletin v3.0.3 with safe mode enabled in PHP and is working fine. The only other modification I had to do was to add
Code:
require_once('./includes/functions_image.php');
to the start of the includes/functions_upload.php file.
Reply With Quote
  #23  
Old 11-11-2004, 08:29 PM
Blindchild02's Avatar
Blindchild02 Blindchild02 is offline
 
Join Date: Apr 2002
Location: USA
Posts: 741
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works great at - www.xamira.net since the avatar is on the homepage thanks alot!!
Reply With Quote
  #24  
Old 11-12-2004, 07:37 AM
lazytown lazytown is offline
 
Join Date: Feb 2004
Posts: 503
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I modded it slightly so that it resizes any image larger than the file limit or the dimensions limit.. However as stated, it probably does increase load on the server. The other problem is users are uploading photos like crazy now.
Reply With Quote
  #25  
Old 11-21-2004, 12:47 PM
remlle remlle is offline
 
Join Date: Oct 2002
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any idea when why when I upload an image that is 800k or abovr it fails. no errors just the upload page turns white with no writing on it.
also
in the file you recomended changing uploading to uploading and resizing attachments and I cant find that do you know where I could find that.
Reply With Quote
  #26  
Old 11-23-2004, 08:50 PM
Hexemer's Avatar
Hexemer Hexemer is offline
 
Join Date: Sep 2003
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

first, thank you for this nice hack.

But, I have a Problem. :disappointed: The uploaded picture is "darker" than the original one.

attachment 1: original
attachment 2: uploaded in my forums

gd version: 2.0.12

Can you help me? :ermm:
Reply With Quote
  #27  
Old 11-23-2004, 09:02 PM
remlle remlle is offline
 
Join Date: Oct 2002
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

same here.
Reply With Quote
  #28  
Old 11-25-2004, 06:24 PM
jarekn jarekn is offline
 
Join Date: Feb 2004
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I still get the error That image is too large. The maximum dimensions are 220 by 220

vbulletin 3.0.3
Running on PHP Version 4.3.4

I only modified the functions_upload.php

No other errors are displayed...I can upload smaller images that are with in the 220 by 220 spec.
Reply With Quote
  #29  
Old 12-04-2004, 06:44 PM
Hexemer's Avatar
Hexemer Hexemer is offline
 
Join Date: Sep 2003
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Hexemer
Hello,

first, thank you for this nice hack.

But, I have a Problem. :disappointed: The uploaded picture is "darker" than the original one.

attachment 1: original
attachment 2: uploaded in my forums

gd version: 2.0.12

Can you help me? :ermm:
No solution for this problem? :ermm:
Reply With Quote
  #30  
Old 12-16-2004, 10:18 PM
biggkay biggkay is offline
 
Join Date: Sep 2003
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where and how do I do the phrase change? I'm n00b at this.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07056 seconds
  • Memory Usage 2,503KB
  • Queries Executed 43 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (30)post_thanks_box
  • (30)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (30)post_thanks_postbit_info
  • (29)postbit
  • (30)postbit_onlinestatus
  • (30)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete