PDA

View Full Version : Auto Resize Image Attachments (Avatars & Profile Pic Too)....


lazytown
11-14-2005, 08:44 AM
A port of the following mod would be very useful to most 3.5 users.
https://vborg.vbsupport.ru/images/darkblue/buttons/collapse_tcat.gif (https://vborg.vbsupport.ru/showthread.php?t=68429&page=1&pp=30#top) Auto Resize Image Attachments (Avatars & Profile Pic Too)....

https://vborg.vbsupport.ru/showthread.php?t=68429&page=1&pp=30 (https://vborg.vbsupport.ru/showthread.php?t=68429&page=1&pp=30)

Flow Fusion
11-14-2005, 10:41 AM
I agree.

oldford
11-17-2005, 04:46 AM
I second (third?) that request. :)

wildondallas
11-26-2005, 05:51 AM
Geek Auto Avatar Resizer (https://vborg.vbsupport.ru/showthread.php?t=78287) works for us, to resize uploaded avatars and profile pictures. Just upgraded to 3.5.1 and had this installed previously. Just tested after the upgrade, and both resized images to the max dimensions set. See my post and screen shots here: https://vborg.vbsupport.ru/showthread.php?p=831196#post831196

ConqSoft
11-26-2005, 05:57 AM
It's already built into 3.5.x...

mvigod
11-26-2005, 12:14 PM
It's already built into 3.5.x...

not for image attachments to posts it isn't

Snake
11-26-2005, 12:28 PM
Yes I am looking forward to this.

Chris M
11-26-2005, 01:29 PM
Ask TheGeek if he plans to port his version to 3.5, and then ask him if he could extend it...

Chris

Cush
11-26-2005, 08:52 PM
I found that to change the Auto-Resize on photos you must go to Admin CP -> Usergroups -> Registered Users
And down towards the middle or bottom there is the sizing option menu.

Good Luck!

007
11-28-2005, 11:28 PM
What if a member's usergroup changes to a group with a smaller avatar max size? It would be nice if avatars automatically resized if the users current usergroup didn't allow it the size that their current one is.

sgtmaj
01-22-2006, 12:49 AM
anyone plan to do this auto resize for attachments for 3.5.xxx??

Snake
01-22-2006, 09:13 AM
Attachments can be resized already as it is a default feature in vBulletin 3.5.x.

BillP
02-07-2006, 08:35 PM
Aftermath-

Please explain how resize of attachments work. Because as far as I can tell, it does NOT.

It will make a thumbnail, but the original picture MUST be within the Attachments dimensions and byte size limits as set in the AdminCP.

mvigod
02-07-2006, 09:46 PM
Aftermath-

Please explain how resize of attachments work. Because as far as I can tell, it does NOT.

It will make a thumbnail, but the original picture MUST be within the Attachments dimensions and byte size limits as set in the AdminCP.


You are correct. It does not resize the image. This hack has yet to be ported to 3.5.

Looking at this I think the following steps would be required to implement this:

1) hack requires possibly increasing your max upload setting php.ini depending where it is set.
2) Next you would have to take the uploaded image (without size or dimension limits) and check to see if it exceeds your set large image size (i.e. 800x600) and if so resize it to the max horizontal/vertical depending on the originals aspect ratio.
3) Next you create the thumbnail.
4) Finally you delete the original oversized image to clean up when done.

Andreas mentioned this could possibly be written as plugin or product but I have not had a chance to figure out how. If anybody wants to take a crack at it then definitely have at it. I don't want to waste time hardcoding it in a file if it can be simplified for others to install as product.

BillP
02-07-2006, 10:45 PM
I have some additional needs....

I'd like the ability to resize existing attachments. Right now the user or the administrator or moderator must save it to their local computer, resize it there, and then upload it to the post.

I'd like the option of using the Attachments Management interface, and where you "edit" have an option to resize in place. I imported my site from Invisionboard, and am now implementing size restrictions, so it would be really valuable to have a "resize in place" function.

A "mass resize in place" script would be really cool. Maybe I'll end up writing that... since I store my attachments in the file system I can simply find a large image in the database, read it its file location, run it through "convert", and then update the database with the new size.

==========edited later==============
I was just looking at the database, VB also stores a filehash for the attachment. Anyone know what that is used for? Is it critical that I fix up that field if I resize the image via a script?

mvigod
02-07-2006, 11:32 PM
billp - check if there is any actual data in the filehash field. I think in my db it is empty.

BillP
02-08-2006, 02:26 AM
There's data in mine.

I wonder if it's from moving the files in and out of the database. It could be a way to ensure that the binaries remain unaltered in the database.

wrang
04-09-2006, 01:21 PM
Yes i want this to.
If a member upload a image like 1200pix with and i haved set that max with is 900pix it should automatic resize the image to 900

is this possible

toolblast
04-16-2006, 09:33 PM
Hey all!

I was looking for a hack that would automatically resize all avatars to a certain dimention. So, for example, I want all avatars to be say... 25x25 in dimention. If the user tries to upload an image that is 26x30, instead of telling him "sorry, upload another one", it would instead automatically resize the image to fit perfectly.

Does the current vb 3.5 version do this? If so, where do I go to set up this setting?

Thanks.

fneumeier
04-17-2006, 04:00 AM
>If a member upload a image like 1200pix with and
>i haved set that max with is 900pix it should automatic
>resize the image to 900

I'm looking for such a plugin or hack for vBulletin for quite a while and found a lot of postings here from people who want the same. But so far, no solution for this. It works for Avatars and Profile pics, but not for "normal" attachment pics.

My approach is: Make it as easy as possible to the user to upload pictures (which is: don't force them to understand pixel resolution, resizing pictures, etc. but just let them upload their digital camera images as they are and the software does the rest).
But the main stream here seams to be: Picture posting only for the tech geeks :-(
An other opinion is: Do resize with "width/height" tag in HTML (which from my point of view is a very silly idea when it comes to a 5- or 8-Megapixel picture ...

Using GDlib it's only a few lines of code to automatically resize a picture, really simple. But I just can't find the hook or position in the code of vBulletin to do it by myself.

***hint*** Maybe someone from the developers can let us know where in the code the image upload is handled and where the best place would be to add the resize code??? ***hint***

Franz

toolblast
04-18-2006, 04:08 AM
I've modified an existing plugin and added the ability to DYNAMICALLY auto resize user avatars. It does it PROPORTIONATELY so that the image doesnt get stretched. You simply type in the maximum height/width and it will resize the image (without touching or editing the original file) to fit within that restriction.

https://vborg.vbsupport.ru/showthread.php?p=952624

This could also be used for profile images and all image attachments, you simply go in and use the imageresize.php code where you want to restrict the file dimentions on any image.

effgee
04-18-2006, 05:50 PM
... This could also be used for profile images and all image attachments, you simply go in and use the imageresize.php code where you want to restrict the file dimentions on any image.

toolblast,

would you (or anyone else 'in the know', for that matter) mind posting instructions on how to implement this for the [IMG] tag? I know that I'd have to stick your code in 'class_bbcode.php' but am stumped as to how to do this.

Thanks much in advance! :)

toolblast
04-18-2006, 11:17 PM
Just post your question in the thread for my plugin and i'll try helping you Effgee.