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

Reply
 
Thread Tools
Geek Auto Avatar Resizer Details »»
Geek Auto Avatar Resizer
Version: 1.00, by The Geek The Geek is offline
Developer Last Online: Jan 2019 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 03-16-2005 Last Update: Never Installs: 33
Is in Beta Stage  
No support by the author.

Basically this is a very simple addition to stop the mega computer literate who use my forums driving everyone insane with their 'I tried to upload my pic as an avatar but its too big - how do I resize it'.

In a nutshell, this will automatically resize the uploaded avatar (and profile picture) to your max dimensions (if it is too big).
It must still be smaller than the Custom Avatar Maximum File Size (bytes) / Profile Picture Maximum File Size (bytes) setting. In fact - it wont even get uploaded if the pic exceeds this size. Therefore I would suggest raising this limit to an appropriate amount.

There is 1 file edit (1 line) and 1 include file.

(Im going to get pissed if someone says there is already a hack for this )

change log
-----------
Update to BETA 1.02 on 18/03/05
Added GD test
Fixed dumb typo that caused image dimensions to not be retrieved.

nJoy

Show Your Support

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

Comments
  #47  
Old 05-30-2005, 10:31 PM
wildondallas's Avatar
wildondallas wildondallas is offline
 
Join Date: Jul 2004
Location: Dallas, TX
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and working great! Hoping this will increase people adding photos for their profile picture and avatar. Thanks for this hack :up:
Reply With Quote
  #48  
Old 05-31-2005, 04:45 PM
Stachel Stachel is offline
 
Join Date: Jun 2004
Location: US
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I have a pic that is 150x100

and avatar limits are 100x100

Will it look distorted when the avatar is uploaded (because it gets changed to be a perfect square) ?

Stachel
Reply With Quote
  #49  
Old 05-31-2005, 07:53 PM
The Geek's Avatar
The Geek The Geek is offline
 
Join Date: Sep 2003
Location: Behind you
Posts: 2,779
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stachel
If I have a pic that is 150x100

and avatar limits are 100x100

Will it look distorted when the avatar is uploaded (because it gets changed to be a perfect square) ?

Stachel
It keeps the ratio - so your image will end up something like 100x75 when done
Reply With Quote
  #50  
Old 06-18-2005, 08:30 PM
paul41598's Avatar
paul41598 paul41598 is offline
 
Join Date: Jun 2004
Location: MI
Posts: 732
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just tried uploading a pic of an animated GIF, that is 120 pixels. I set the max width to 90 in my CP.

This is the error Im getting with an animated gif:

PHP Code:
Warningimagecreatetruecolor(): Invalid image dimensions in /includes/functions_geekautoavatar.php on line 44

Warning
imagecopyresampled(): supplied argument is not a valid Image resource in /includes/functions_geekautoavatar.php on line 45

Warning
imagegif(): supplied argument is not a valid Image resource in /includes/functions_geekautoavatar.php on line 53

Warning
imagedestroy(): supplied argument is not a valid Image resource in /includes/functions_geekautoavatar.php on line 58 
Reply With Quote
  #51  
Old 06-19-2005, 09:05 AM
The Geek's Avatar
The Geek The Geek is offline
 
Join Date: Sep 2003
Location: Behind you
Posts: 2,779
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by paul41598
I just tried uploading a pic of an animated GIF, that is 120 pixels. I set the max width to 90 in my CP.

This is the error Im getting with an animated gif:

PHP Code:
Warningimagecreatetruecolor(): Invalid image dimensions in /includes/functions_geekautoavatar.php on line 44

Warning
imagecopyresampled(): supplied argument is not a valid Image resource in /includes/functions_geekautoavatar.php on line 45

Warning
imagegif(): supplied argument is not a valid Image resource in /includes/functions_geekautoavatar.php on line 53

Warning
imagedestroy(): supplied argument is not a valid Image resource in /includes/functions_geekautoavatar.php on line 58 
Does it not happen with a standard gif? To be honest it looks like the GD settings in vboptions is incorrect.
Reply With Quote
  #52  
Old 06-19-2005, 11:42 AM
paul41598's Avatar
paul41598 paul41598 is offline
 
Join Date: Jun 2004
Location: MI
Posts: 732
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No it works fine with a standard gif actually. Animated though errors out.
Reply With Quote
  #53  
Old 08-17-2005, 04:01 AM
DimensionZero DimensionZero is offline
 
Join Date: Jul 2005
Location: Vancouver, BC
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by paul41598
I just tried uploading a pic of an animated GIF, that is 120 pixels. I set the max width to 90 in my CP.

This is the error Im getting with an animated gif:

PHP Code:
Warningimagecreatetruecolor(): Invalid image dimensions in /includes/functions_geekautoavatar.php on line 44

Warning
imagecopyresampled(): supplied argument is not a valid Image resource in /includes/functions_geekautoavatar.php on line 45

Warning
imagegif(): supplied argument is not a valid Image resource in /includes/functions_geekautoavatar.php on line 53

Warning
imagedestroy(): supplied argument is not a valid Image resource in /includes/functions_geekautoavatar.php on line 58 

AHA! I figured it out!
I had the same problem with a jpeg that was perfectly square. The problem lies in the function starting at line 30.

Code:
            //decide which is the % of shrinkage to use
            if ($shrinkx<$shrinky){
                $ratio=$shrinkx;
            }elseif($shrinky<$shrinkx){
                $ratio=$shrinky;
            }
What's happening is that since it's square, the ratios are the same and there's no condition to handle it so it sets $ratio to 0

The fix is simple

Code:
            //decide which is the % of shrinkage to use
            if ($shrinkx<$shrinky){
                $ratio=$shrinkx;
            }elseif($shrinky<$shrinkx){
                $ratio=$shrinky;
            }else{
		$ratio=$shrinkx;
            }
Just set ratio to one of the 2 shrink values.

Hope this helps you all out!
Reply With Quote
  #54  
Old 11-26-2005, 05:46 AM
wildondallas's Avatar
wildondallas wildondallas is offline
 
Join Date: Jul 2004
Location: Dallas, TX
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We just upgraded to 3.5.1 this past week, and I had installed this hack previously. Just tested both the Avatar and Profile picture upload to make sure it is resizing the images to the limits set, and it seems to be working fine still. After the upgrade I also changed some of the code in the templates for each, to let members know that it will auto resize their images for them, and what the file size limits are. (See screenshots)
Reply With Quote
  #55  
Old 11-26-2005, 05:52 AM
ConqSoft's Avatar
ConqSoft ConqSoft is offline
 
Join Date: Jul 2003
Location: Raleigh, NC
Posts: 686
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Umm, 3.5.x has built in Avatar and Profile Pic resizing.
Reply With Quote
  #56  
Old 11-26-2005, 05:56 AM
wildondallas's Avatar
wildondallas wildondallas is offline
 
Join Date: Jul 2004
Location: Dallas, TX
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ConqSoft
Umm, 3.5.x has built in Avatar and Profile Pic resizing.
Ha ha ha, shows you what I know...I saw some people requesting something for it in the 3.5 mod request forum here: https://vborg.vbsupport.ru/showthread.php?t=100768

Maybe they don't know either.LOL Thanks
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 12:01 AM.


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.04810 seconds
  • Memory Usage 2,324KB
  • Queries Executed 25 (?)
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
  • (2)bbcode_code
  • (3)bbcode_php
  • (4)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
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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