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)
-   -   Auto resizing of avatars (https://vborg.vbsupport.ru/showthread.php?t=44680)

msimplay 03-08-2003 03:06 AM

have the boards gone dead no hacker wants to help anymore
even where it says the hacker agreed to give help

Lol infact the ones that say cannot guarantee help seem to helping more these days :P

LangTuDaTinh 03-09-2003 07:21 PM

PHP SAFE MODE MUST BE OFF TO USE THIS HACK. ELSE IT' WON'T WORK

warpeditor 03-10-2003 12:52 PM

It doesn't work with 2.3.0, does it? I got parse error.

Parse error: parse error, unexpected '}' in /home/somewhere/public_html/vb/admin/functions.php on line 1829

Imagemagick installed, safe upload mode off.

LangTuDaTinh 03-21-2003 06:16 PM

check your code....remove 1 extra "}"

it should work

i found another bug....if a gif dimension is smaller than avatarmaxdimension in setting then this hack will not run. and the size will not change

forexample a user have a gif avatar with size 1mb and dimension is smaller than the one i specified in setting than he will be able to upload his avatar.... so u need to change the code in admin/functions.php

Pikok 08-02-2003 04:23 AM

I'm running linux on my server, and they're saying they support everything except some, but as you'd suppose. Linux isnt there!

corsacrazy 10-24-2003 09:17 PM

any updates on this would be great

Keith 02-09-2004 01:47 AM

I don't have ImageMagick, but we do have GD v2 installed. PhotoPost uses GD2 to resize jpeg images. This appears to be the line you're using to resize the image.
Code:

$cmd = "/usr/local/bin/mogrify -resize $newsize "."$attachment 2>&1";
Is it as simple as using a GD equivalent command to replace this? If so, can you list it out here?

sgtmaj 02-09-2004 03:33 PM

Quote:

Originally Posted by Dmitriy
By the way, I just added an auto-resize for attached images to keep images under the max size. Basically the same think, edit the functions.php in the same manner (almost):

if ($extension=="gif" or $extension=="jpg" or $extension=="jpeg" or $extension=="jpe" or $extension=="png" or $extension=="swf") { // Picture file
if ($imginfo=@getimagesize($attachment)) {
if (($maxattachwidth>0 and $imginfo[0]>$maxattachwidth) or ($maxattachheight>0 and $imginfo[1]>$maxattachheight)) {

$image_width = $imginfo[0];
$image_height= $imginfo[1];

if ($image_width > $maxattachwidth)
{
$sizefactor = (double) ($maxattachwidth / $image_width);
}
elseif ($image_height > $maxattachheight)
{
$sizefactor = (double) ($maxattachheight / $image_height) ;
}


$newwidth = (int) ($image_width * $sizefactor);
$newheight = (int) ($image_height * $sizefactor);

$newsize = $newwidth . "x" . $newheight;

$cmd = "/usr/local/bin/mogrify -resize $newsize "."$attachment 2>&1";

exec($cmd, $exec_output, $exec_retval);
if($exec_retval > 0)
{
print "ERROR: exec() error: $exec_output[0]";
}
else
{
print "<P align=\"center\"><b>Image was resized from " . $image_width . "x" .
$image_height . " to $newsize</p>";
}

}

what code in my current functions.php do I replace your code with???

Willard Reece 02-09-2004 04:05 PM

Looks like this seems to work , but on either part you use it says it makes the image smaller but when you look at the image , it is the same size as before ,
Post a attachment on forums and it says image has been resized, but it don't work.

could this be in imagemajicK not set right???

even the avatar part works the same, so unlees its something to do with the vb admin settings then it has to be in the imagemajicK setting I would think.....


All times are GMT. The time now is 05:15 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.01291 seconds
  • Memory Usage 1,734KB
  • 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_code_printable
  • (1)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
  • (9)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