Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Auto Resize Image Attachments (Avatars & Profile Pic Too).... Details »»
Auto Resize Image Attachments (Avatars & Profile Pic Too)....
Version: 1.00, by mini2 mini2 is offline
Developer Last Online: Oct 2010 Show Printable Version Email this Page

Version: 3.0.6 Rating:
Released: 08-16-2004 Last Update: 11-11-2004 Installs: 73
 
No support by the author.

Gone

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 03-10-2005, 02:39 PM
John_44 John_44 is offline
 
Join Date: Aug 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, i played around with it. Please notice that i know nothing about PHP, but i was able to track down the Problem:

If i change:

if ($width_factor > $height_factor)
{
$nw = round($w / $width_factor);
$nh = round($h / $width_factor);
}

to:

if ($width_factor > $height_factor)
{
$nw = 400 ;
$nh = round($h / $width_factor);
}

it works. 500,600,1000 -> Anything bigger 400 don?t.
I guess that for some reasons ImeageCreateTrueColor don?t like big numbers.. but i have no Ideas why.
The image i used was a Standart jpg with 1600*1200. Size played no role.

I would really apreciate your help on this topic, as i will definitly extend this genius hack !

What i want to add:
-Other extension (.jpeg,.jpe ...)
-File size

Does anybody know if GDlib can read EXIF Data ?

(Yes my English sucks )
Reply With Quote
  #43  
Old 03-10-2005, 02:52 PM
John_44 John_44 is offline
 
Join Date: Aug 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry. It works with 450 and 500. But 600 is to mutch. This makes me sick.

(And it is not "ImageCopyResampled". The following line works just fine:

ImageCopyResampled($ni,$im,0,0,0,0,1000,$nh,$w,$h) ; )
Reply With Quote
  #44  
Old 03-10-2005, 04:45 PM
John_44 John_44 is offline
 
Join Date: Aug 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If somebody else has the same Problem: As a workaround i use:

$width_factor = $w / 500;
$height_factor = $h / 500;
if ($width_factor > $height_factor)
{
$nw = round($w / $width_factor);
$nh = round($h / $width_factor);
}
else
{
$nw = round($w / $height_factor);
$nh = round($h / $height_factor);
}

$ni=imagecreatetruecolor($nw,$nh);
ImageCopyResampled($ni,$im,0,0,0,0,$nw,$nh,$w,$h);
UnsharpMask($ni);
Reply With Quote
  #45  
Old 03-10-2005, 07:43 PM
John_44 John_44 is offline
 
Join Date: Aug 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And i found a Bug: If more than one Image is resized, the script returns an error 500. However the first one is still uploaded.

Anybody else with this error ?
Reply With Quote
  #46  
Old 03-29-2005, 02:02 AM
nosaj nosaj is offline
 
Join Date: Mar 2005
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks mini2, installed and working on my vBulletin Version 3.0.7 Forum. :classic:
Reply With Quote
  #47  
Old 03-31-2005, 06:20 PM
LiewCF's Avatar
LiewCF LiewCF is offline
 
Join Date: Mar 2005
Location: Malaysia
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great! this hack work for my bloggers forum. There is other similar hack too, but it does not work.

Thank you!
Reply With Quote
  #48  
Old 04-03-2005, 10:09 AM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I started to install this hack on 3.0.3
but in the functions_file.php I could not find the section that says:

Code:
@unlink($attachment);
eval('$error = "' . fetch_phrase('attachbaddimensions', PHRASETYPEID_ERROR) . '";');
$errors[] = array(
	'filename' => $attachment_name,
	'error' => $error...
is there another portion of code I should look for?
Reply With Quote
  #49  
Old 04-18-2005, 09:00 PM
Blam Forumz Blam Forumz is offline
 
Join Date: Jun 2004
Posts: 554
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

for attachments is it possible for them to be clikabkle?
Reply With Quote
  #50  
Old 04-25-2005, 01:32 AM
Harley D's Avatar
Harley D Harley D is offline
 
Join Date: Jan 2003
Location: WagnerTech.net
Posts: 266
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mini2
No idea on the darker image, I cant reproduce the problem.
I have a PHP Store that has pic resizing, and I've found that gif, jpegs, and pngs.... one of those will darken when resized. try changing the type of file and upload it to see how it renders after being resized.
Reply With Quote
  #51  
Old 04-25-2005, 01:37 AM
Harley D's Avatar
Harley D Harley D is offline
 
Join Date: Jan 2003
Location: WagnerTech.net
Posts: 266
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Hexemer
Hello,

first, thank you for this nice hack.

But, I have a Problem. :disappointed: The uploaded picture is "darker" than the original one.

attachment 1: original
attachment 2: uploaded in my forums

gd version: 2.0.12

Can you help me? :ermm:

I did some more checking and found that .JPG will darken but .GIF doesn't.
So use paint shop or photo shop to change from a JPG to GIF, this should solve this problem. If it does, please post so other will know if it works.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05418 seconds
  • Memory Usage 2,304KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete