vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Auto Resize Image Attachments (Avatars & Profile Pic Too).... (https://vborg.vbsupport.ru/showthread.php?t=68429)

memdy 08-31-2004 05:25 PM

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

CVMagic 09-01-2004 01:25 PM

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.

memdy 09-01-2004 01:38 PM

<a href="http://www.offshoreonly.com/phpinfo.php" target="_blank">http://www.offshoreonly.com/phpinfo.php</a>

CVMagic 09-01-2004 01:40 PM

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

Blindchild02 09-05-2004 10:47 PM

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

Blindchild02 09-05-2004 11:51 PM

alrite, adding require_once('./includes/functions_image.php'); worked

johnnyb 09-30-2004 07:23 PM

I uploaded everything, and modified everything, but the images aren't resized?

calvinnguyen 10-22-2004 08:31 AM

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.

calvinnguyen 10-22-2004 10:11 AM

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?

Natch 10-24-2004 10:16 PM

Actually, there is a vB3 option to allow public viewing of phpinfo()...


All times are GMT. The time now is 10:42 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.00943 seconds
  • Memory Usage 1,741KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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