Tips and Tricks HQ Support Portal › Forums › WP eMember › Limit users profile image file size?
Tagged: display picture, profile image
- This topic has 15 replies, 7 voices, and was last updated 10 years, 6 months ago by Mcp.
-
AuthorPosts
-
July 26, 2010 at 3:53 pm #1558jeffwMember
Hi… is there any additional code I can add to either a) limit the file size, or b) limit the image pixel size? Right now, there is nothing stopping someone from uploading a huge file, so when it’s being called, i.e. in comments, the huge file is loading, even though it’s styled to be small, it’s unnecessary bandwidth hogging.
Thanks!
July 27, 2010 at 2:38 am #22774amin007ParticipantThe image size limit is 2MB.
If you want to change this limit then open the “emember_ajax.php” file and you will see a function called “wp_emem_upload_file” where limit is set to 2048.
July 27, 2010 at 4:11 am #22775jeffwMemberHi… Thanks for the response.
However, I’m not seeing the file limit. I see the function, just no reference to any file limit or even 2048. I’m using eMember 5.4.5
Thanks.
July 27, 2010 at 7:05 am #22776amin007ParticipantHave you searched for 2048 in the “emember_ajax.php” file?
July 28, 2010 at 2:24 am #22777jeffwMemberYes, I did that initially, then manually searched. What number line is it appearing in?
July 28, 2010 at 5:50 am #22778IvyMemberHi Jeff, I have sent you an update via email as I believe you may be using a older version of the eMember. Please let me know if you do not receive this email.
May 26, 2012 at 5:38 am #22779DMartinMemberIs there any way to integrate this function with TimThumb or similar to create a tiny version of the uploaded photo? I would like to display the members image on their member homepage, but I am a bit concerned that this will slow things down significantly if they have a large file. Most people are not aware or able to resize images themselves, so to limit the image size to say half a meg would make it difficult for some to upload their profile, but if we allowed 2MB as specified above, and then a simple script craetes a thumbnail for general use throughout the site, that would be fab.
May 26, 2012 at 11:21 pm #22780adminKeymasterHow are you planning to show the image on the homepage?
May 27, 2012 at 4:48 am #22781DMartinMemberI noticed in the emember shortcodes that there is now a shortcode to show the profile image
May 27, 2012 at 11:25 pm #22782adminKeymasterOkay I will look into it.
May 3, 2014 at 7:29 pm #22783McpMemberHi, i have the same problem, in the “emember_ajax.php” file, i can’t find the 2048. Can you send me the update by mail please. I use the V8.8.6.
Thanks a lot
May 3, 2014 at 9:05 pm #22784wzpModeratorThe previous advice is out of date.
Depending on your version of eMember:
Edit the file(s): emember_ajax.php and/or emember_ajax2.php
Look for a function definition called: wp_emem_process_fileupload()
Then look for:
// max file size in bytes
$sizeLimit = 10 * 1024 * 1024;Change values as you see fit.
Hint(s): 10*1024 bytes = 10KB and 10*1024*1024 = 10MB
- The maximum upload limit for a Twitter profile picture is 500 by 500
= 250KB = 250*1024 - The actual maximum size displayed for a Twitter profile picture is 128 by 128
= 16KB = 16*1024
May 3, 2014 at 9:35 pm #22785McpMemberYes i saw, that’s out of date, but i did not want create a new topic for the same answer.
i modified the function, it’s ok!
Thanks you for your reply.
May 9, 2014 at 7:28 pm #22786McpMemberHi, I have another question,
is it possible to add hook or code to allow eMember change the picture size?
I modified the function to limit the file size and i’ll need to emember change the picture size when the user uploaded his picture to reduce to 128 by 128.
May 9, 2014 at 8:29 pm #22787wzpModeratorAre you looking for this?
https://support.tipsandtricks-hq.com/forums/topic/changing-dimensions-of-gravatar
Remember, the display size is not the same as the file size.
- The maximum upload limit for a Twitter profile picture is 500 by 500
-
AuthorPosts
- You must be logged in to reply to this topic.