View Full Version : 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
What version of PHP are you using?
That function is part of PHP 3.0.16+ and PHP 4.0.0+
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?
Ah, thanks freddie forgot about the GD library :o
BlueWolf, download the updated file and set $aron to 0 and set $sz to 50.
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.
Parse error: parse error in /business/XXXXXXX/html/vbulletin/avatarcreator.php on line 14
The Realist
03-24-2002, 04:33 AM
PHP Version 4.0.6
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?
Originally posted by ptbyjason
I am probably doing something real stupid, but if I create a link to that php file I get.
Parse error: parse 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
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
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.
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.netGD 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. :)
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
03-06-03 at 10:25 AM Bad Bunny said this in Post #25 (https://vborg.vbsupport.ru/showthread.php?postid=361957#post361957)
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
Today at 12:37 AM freddie said this in Post #28 (https://vborg.vbsupport.ru/showthread.php?postid=375802#post375802)
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/forums/avatarcreator.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.
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.
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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.