vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Community Lounge (https://vborg.vbsupport.ru/forumdisplay.php?f=13)
-   -   the gd library for php (https://vborg.vbsupport.ru/showthread.php?t=50376)

mr e 03-18-2003 03:06 AM

the gd library for php
 
ok im confused about this whole gd library thing, i have php 4.3.0 and i read something about the gd library built in, is it on 4.3.0? if not how do i install it, i've been to the site and that was confusing too? also, can anyone give me an idea or a website on how to use it?

filburt's sig inspired this question :)

Velocd 03-18-2003 03:20 AM

A variation of GD2.0 is preinstalled with PHP 4.3.0

If you must check, you can create a PHP file with the following contents, and run it in your browser to check the GD status on your server:
PHP Code:

<?php
phpinfo
();
?>


filburt1 03-18-2003 01:57 PM

If you plan on duplicating my idea beware that I have a cron job cache the stats every 15 minutes, mainly because it uses around five queries to create the image. If it did that every time somebody requested the image then it would kill the server.

mr e 03-18-2003 05:19 PM

so would it be better to go install the newest version of gd?

filburt1 03-18-2003 05:20 PM

You're best off installing PHP 4.3.1 which includes the latest version of the GD library.

mr e 03-18-2003 05:39 PM

ok cool, thanks filburt

mr e 03-18-2003 07:46 PM

ok i have php 4.3.1 installed on my windows server, but if i try to use ImageCreateFromPng i get an undefined function error...any help here?

Freddie Bingham 03-18-2003 08:54 PM

You have to specify --with-gd for the GD to be enabled. If you want PNG you also have to add --with-png-dir=/usr assuming your png libraries are in /usr.

mr e 03-18-2003 10:37 PM

ok now where do i specify that? in the php.ini file? and i have to go to other websites to get the jpg/png libraries right?

filburt1 03-18-2003 10:41 PM

Search for extensions_dir, change it to where you installed php\extensions, and then uncomment the line for GD. In Windows you don't need to recompile it, just restart Apache.

edit: you can output PNGs and JPEGs directly with the built-in module. I think you can read GIFs, too.

mr e 03-19-2003 05:24 AM

ok i did all that, except now when i restart apache it says it cannot load the dynamic library, module cannot be found, but it gives the path and the file IS there, php_gd.dll and php_gd2.dll are both there and i've tried doing both, im lost here

mr e 03-19-2003 05:32 AM

never mind, got it to work, i think i had the "extensions" directory name spelled wrong in php.ini, :)

N!ck 03-19-2003 05:52 AM

Mr. E, you also might consider using a cron job to generate your image rather than just storing the stats in a text file or something. It will cut down on server load (to some extent).

mr e 03-19-2003 06:22 AM

lol, i have no idea how to work cron jobs

mr e 03-19-2003 06:29 AM

oh also, how come when i set it to create image from jpeg it's actually better quality (more colors) than png and when i do a jpeg and with the imagecolorallocate it never changes the text color, the bg is black and the text is there, but a very dark bluish color i think, i want to make it white

N!ck 03-19-2003 06:43 AM

Use imagecolorclosest() for JPEGs rather than imagecolorallocate(). The functions are identical in syntax, but imagecolorclosest() is necessary when working with JPEGs.

mr e 03-19-2003 06:46 AM

oooh! cool thanks


All times are GMT. The time now is 06:53 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.01186 seconds
  • Memory Usage 1,739KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (17)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete