The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Auto Resize Image Attachments (Avatars & Profile Pic Too).... Details »» | |||||||||||||||||||||||||||
Auto Resize Image Attachments (Avatars & Profile Pic Too)....
Developer Last Online: Oct 2010
Gone
Show Your Support
|
Comments |
#32
|
|||
|
|||
Nice hack... thanks...
|
#33
|
||||
|
||||
I have been looking for this hack..
[high]* KTBleeding will install when he gets off work. [/high] EDIT: Installed and working fine! I'm so glad I found this hack. [high]* KTBleeding clicks install[/high] |
#34
|
|||
|
|||
Im getting a error on uploading a avatar thats bigger then the dimentions set...
Fatal error: Call to undefined function: remote_filesize() in /usr/local/apache/www/crazyapes/majorfmforum.com/htdocs/forum/includes/functions_upload.php on line 106 |
#35
|
|||
|
|||
could not get this working at all
always says the image is to large and makes no attempt to resize .. checked and double checked all the editing that was needed ... (tryed with profiles & atachments) running vb 3.0.3 with the latest security fix's applied attachments stored in the filesystem .. but would not think this would affect the profile pic as they are in the dbase .. and they don't work either .. |
#36
|
||||
|
||||
Parse error: parse error, unexpected T_ELSE in /home3/nzboards/public_html/forums/includes/functions_upload.php on line 341
That's just trying to upload a gif larger than the dimensions. Same thing happens if I use jpg. |
#37
|
||||
|
||||
Quote:
PHP Code:
Context - lines 321 to 362 PHP Code:
|
#38
|
|||
|
|||
Hey, this works well for me .. but is there a way so that when an image is reduced in size, you can click on it (in post) to view it full size in a new window or something? Thanks.
|
#39
|
|||
|
|||
Quote:
|
#40
|
|||
|
|||
Very nice Hack !
Unfortunatly it doesn´t work for me. No errors until i upload a larger Image -> Then it says Error 500 -> could not execute Script. I´m using the German Provider 1&1 and would apreciate every help possible. (GD Lib is installed) |
#41
|
|||
|
|||
No, it always hapens.
|
#42
|
|||
|
|||
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 ) |
#43
|
|||
|
|||
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) ; ) |
#44
|
|||
|
|||
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); |
#45
|
|||
|
|||
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 ? |
#46
|
|||
|
|||
thanks mini2, installed and working on my vBulletin Version 3.0.7 Forum. :classic:
|
#47
|
||||
|
||||
Great! this hack work for my bloggers forum. There is other similar hack too, but it does not work.
Thank you! |
#48
|
|||
|
|||
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... |
#49
|
|||
|
|||
for attachments is it possible for them to be clikabkle?
|
#50
|
||||
|
||||
Quote:
|
#51
|
||||
|
||||
Quote:
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. |
#52
|
||||
|
||||
Excellent hack! *clicks install* Does exactly what is says on the tin :-)
Just a quick question tho, do the 'original' large files automatically get deleted off the server or do we have to do that manually? Also a note for people using the attachment resizer, you have to 'increase' the sizes in your ACP to let the larger files get uploaded to then be resized. :-) |
#53
|
||||
|
||||
Sometimes the images shown (JPG) are a bit dark... anyway to get them lighter? :-/
Most users wont know how to conver to gif, so thats not any option really... |
#54
|
||||
|
||||
Uploaded all as per instructions,doesn't seem to be working
Do you need safe mode turned off for this to work... Uploaded the 2 hacks,no errors or anything but doesn't work :ermm: Edit: Got the avatar hack working,slight problem same as another user, the pic is slightly darker |
#55
|
|||
|
|||
Thanks for that wiked hack
|
#56
|
|||
|
|||
anyone know if you can intergrate this into vb gallery?
|
#57
|
|||
|
|||
Excellent hack.
I see a couple of small problems with it though:
I've fixed these problems, and also did some code cleanup. You can uncomment error_log() lines and change email to your actual address to get some idea how this hack performs. Code:
// HACK: auto resize uploaded images switch ($imginfo[2]) { case 1: $im = ImageCreateFromGIF($attachment); break; case 2: $im = ImageCreateFromJPEG($attachment); break; case 3: $im = ImageCreateFromPNG($attachment); break; // no way to handle these image types default: // error_log("Couldn't resize $attachment ($filesize bytes)", 1, "email@yourdomain.net"); @unlink($attachment); eval('$error = "' . fetch_phrase('attachbaddimensions', PHRASETYPEID_ERROR) . '";'); $errors[] = array( 'filename' => $attachment_name, 'error' => $error ); return false; } $w = $imginfo[0]; $h = $imginfo[1]; $width_factor = $w / $maxattachwidth; $height_factor = $h / $maxattachheight; if ($width_factor > $height_factor) { $nw = round($w / $wdth_factor); $nh = round($h / $wdth_factor); } else { $nw = round($w / $height_factor); $nh = round($h / $height_factor); } $ni = @ImageCreateTrueColor($nw, $nh); if ($ni OR !@ImageCopyResampled($ni, $im, 0, 0, 0, 0, $nw, $nh, $w, $h)) { // failed to resize this image // error_log("Couldn't resize $attachment ${w}x${h} to ${nw}x${nh} ($filesize bytes)", 1, "email@yourdomain.net"); @unlink($attachment); eval('$error = "' . fetch_phrase('attachbaddimensions', PHRASETYPEID_ERROR) . '";'); $errors[] = array( 'filename' => $attachment_name, 'error' => $error ); return false; } @ImageDestroy($im); if (PHP_VERSION != '4.3.2' AND $vboptions['attachthumbs'] == 2) { require_once('./includes/functions_image.php'); UnsharpMask($ni); } switch ($imginfo[2]) { case 1: @ImageGIF($ni, $attachment); break; case 2: @ImageJPEG($ni, $attachment, 70); break; case 3: @ImagePNG($ni, $attachment); break; } @ImageDestroy($ni); $filesize1 = @filesize($attachment); // error_log("Resized $attachment ${w}x${h} to ${nw}x${nh} ($filesize to ${filesize1})", 1, "email@yourdomain.net"); $filesize = $filesize1; // /HACK |
#58
|
|||
|
|||
kmike,
nice fixes. has anyone tested this yet on 3.5 RC2? |
#59
|
|||
|
|||
I am getting this error when attempting the Profile Pic modification:
Fatal error: Call to undefined function: unsharpmask() in /home/website/forums/includes/functions_upload.php on line 294 EDIT: Nevermind added require_once('./includes/functions_image.php'); and it works! |
#60
|
|||
|
|||
Can this one please be ported to vB3.5?
|
#61
|
|||
|
|||
A port to 3.5 would be VERY useful.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|