vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Avatar Creator/Resizer (https://vborg.vbsupport.ru/showthread.php?t=36466)

Raz 03-22-2002 10:00 PM

Avatar Creator/Resizer
 
This is more like an additional file than a "hack".

What it does is allow members to resize a jpeg to the standard 64x64 jpeg....while keeping the aspect ratio - and use it as their avatar.

This isn't FULLY automated because when a jpeg is submitted, it will send BACK a resized version, then the user can use that file to upload it to wherever.

Installation:
Upload the attached file to your forums directory. Put a link somewhere to let your forum users know about the new feature. Suggested template is: modifyavatar_customupload

UPDATE: Uploaded Version 1.01 (Added two custom variables. Can keep aspect ratio and avatar max size. )

UPDATE: New v1.02 (Fixed some typos)

The Realist 03-23-2002 02:39 PM

Installed php file, getting this following error:

Fatal error: Call to undefined function: imagecreatefromjpeg() in /usr/local/psa/home/vhosts/skytronic-forums.com/httpdocs/forum/avatarcreator.php on line 76

Raz 03-23-2002 02:44 PM

What version of PHP are you using?

That function is part of PHP 3.0.16+ and PHP 4.0.0+

Neo 03-23-2002 03:48 PM

Wow. This looks really cool.

Freddie Bingham 03-23-2002 03:51 PM

This hack will require your PHP to have GD support compiled in.

defnot 03-23-2002 03:54 PM

great !!!

but i have every time the same error..

"Sorry, only jpeg pictures can be resized here!"

but my pic are a JPG...

BlueWolf 03-23-2002 05:19 PM

O.k this hack works fine to me, only problem I like to solve is to make the pictures as it's on the setting for my board 50x50 and not as 64x15 witch is the size that the avatar hack is doing.

any sugestion?

Raz 03-23-2002 07:02 PM

Ah, thanks freddie forgot about the GD library :o

BlueWolf, download the updated file and set $aron to 0 and set $sz to 50.

Raz 03-23-2002 07:26 PM

Quote:

Originally posted by defnot
great !!!


but i have every time the same error..


"Sorry, only jpeg pictures can be resized here!"


but my pic are a JPG...

It may have a jpg extention, but it seems it wasn't encoded using the JPEG standard.

ptbyjason 03-24-2002 01:50 AM

I am probably doing something real stupid, but if I create a link to that php file I get.

PHP Code:

Parse errorparse error in /business/XXXXXXX/html/vbulletin/avatarcreator.php on line 14 


The Realist 03-24-2002 04:33 AM

PHP Version 4.0.6

Quote:

Originally posted by Raz
What version of PHP are you using?

That function is part of PHP 3.0.16+ and PHP 4.0.0+


inetd 03-24-2002 09:13 AM

Do you have demo?

Raz 03-24-2002 12:16 PM

Quote:

Originally posted by ptbyjason
I am probably doing something real stupid, but if I create a link to that php file I get.

PHP Code:

Parse errorparse error in /business/XXXXXXX/html/vbulletin/avatarcreator.php on line 14 


Sorry ptbyjason, you'll need to download the new file.

Sorry about this, it IS my first hack :D

Raz 03-24-2002 12:17 PM

Quote:

Originally posted by The Realist
PHP Version 4.0.6


You'll need the GD lib, as freddie said, built in.

ptbyjason 03-24-2002 01:50 PM

Quote:

Originally posted by Raz
Sorry ptbyjason, you'll need to download the new file.

Sorry about this, it IS my first hack :D

It works perfectly now. Thank you and great first hack.

ExcErr 03-25-2002 06:54 AM

why only jpeg? may be gif for example?

Freddie Bingham 03-25-2002 10:08 AM

The GD library doesn't support .gif any longer due to copyright issues.

Raz 03-25-2002 03:00 PM

Hmm...according to php.net the functions exist.

I didn't add gif support as a resized gif wouldn't look that great.

[Edit]

Freddies right, according to php.net
Quote:

GD stopped supporting Gif images in version 1.6.

powerkills 05-30-2002 06:04 PM

If you could modify this to allow a selection of either GD Lib or ImageMagick calls that would allow me to use it (need the GIF support). Yes I could just modify yours, but I thought you might want to put this option in a future release. Plus I am way too busy. ;)

BTW Thanks for your efforts. This is truly a great idea. :)

Raz 05-30-2002 07:20 PM

If theres enough demand, I would be willing to add more options.

Birdie501 05-31-2002 04:14 PM

yes please add more options to it!

JZarate 06-01-2002 09:57 PM

I like the idea. But the actual photo quality doesn't turn out too great. I wish it could sharpen and change the bightness/contrast. :) Thanks though, it will help the people who don't have any other options.

LangTuDaTinh 03-06-2003 07:20 AM

after upgrade to PHP v4.3.1 this hack doesn't work.

checkout the attachment....that's the image after resized.

Bad Bunny 03-06-2003 02:25 PM

I get a strange blurry blue/black image like that no matter what jpeg I resize as well. :(

LangTuDaTinh 03-06-2003 03:43 PM

i have the same thing, bad bunny, which php and gd version u have on your system?

jbear6 03-30-2003 09:03 PM

Quote:

03-06-03 at 10:25 AM Bad Bunny said this in Post #25
I get a strange blurry blue/black image like that no matter what jpeg I resize as well. :(
I get the same image. This worked when I tested it last month, but we upgraded to php 4.3.1 since then. Has anyone found a way around this problem?

Thanks
Jbear6

Freddie Bingham 03-31-2003 04:37 AM

Replace $dst_img = imagecreate($new_width,$new_height); with $dst_img = imagecreatetruecolor($new_width,$new_height);

jbear6 03-31-2003 12:13 PM

Quote:

Today at 12:37 AM freddie said this in Post #28
Replace $dst_img = imagecreate($new_width,$new_height); with $dst_img = imagecreatetruecolor($new_width,$new_height);
:banana: Thanks freddie! :banana: That worked just fine :)

Jbear6

Splitfyre 04-14-2003 01:51 AM

1. Trying to figure out what I need to put within my
modifycustomavatar template so I can link it accordingly.

2. When I run the function, there is no Keep Size Aspect Ratio
function showing:

http://www.futurelooksforums.com/for...tarcreator.php

Help!

Splitfyre 04-15-2003 02:48 AM

anybody?

LangTuDaTinh 04-15-2003 02:58 AM

in modifycustomavatar template, place a link to that file in there....anywhere u want.

PHP Code:

in that file there is a variable this "$aron = 1" 

did u set it to zero?, set it to 1 


Splitfyre 04-15-2003 07:00 PM

Can we get support for the GIF format.

Raz 05-26-2003 12:39 PM

I've changed my own code to use the NetPBM package instead of PHP. Much better quality pictures, but unfortuneltly not ready for public release.


All times are GMT. The time now is 04:51 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.01305 seconds
  • Memory Usage 1,779KB
  • 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_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (33)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