vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Geek Auto Avatar Resizer (https://vborg.vbsupport.ru/showthread.php?t=78287)

paul41598 06-19-2005 11:42 AM

No it works fine with a standard gif actually. Animated though errors out.

DimensionZero 08-17-2005 04:01 AM

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! :D

wildondallas 11-26-2005 05:46 AM

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)

ConqSoft 11-26-2005 05:52 AM

Umm, 3.5.x has built in Avatar and Profile Pic resizing. ;)

wildondallas 11-26-2005 05:56 AM

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


All times are GMT. The time now is 06:59 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.01028 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete