Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Limit users profile image file size?

by

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 11 years ago by Mcp.
Viewing 15 posts - 1 through 15 (of 16 total)
1 2 →
  • Author
    Posts
  • July 26, 2010 at 3:53 pm #1558
    jeffw
    Member

    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 #22774
    amin007
    Participant

    The 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 #22775
    jeffw
    Member

    Hi… 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 #22776
    amin007
    Participant

    Have you searched for 2048 in the “emember_ajax.php” file?

    July 28, 2010 at 2:24 am #22777
    jeffw
    Member

    Yes, I did that initially, then manually searched. What number line is it appearing in?

    July 28, 2010 at 5:50 am #22778
    Ivy
    Member

    Hi 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 #22779
    DMartin
    Member

    Is 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 #22780
    admin
    Keymaster

    How are you planning to show the image on the homepage?

    May 27, 2012 at 4:48 am #22781
    DMartin
    Member

    I noticed in the emember shortcodes that there is now a shortcode to show the profile image

    May 27, 2012 at 11:25 pm #22782
    admin
    Keymaster

    Okay I will look into it.

    May 3, 2014 at 7:29 pm #22783
    Mcp
    Member

    Hi, 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 #22784
    wzp
    Moderator

    The 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 #22785
    Mcp
    Member

    Yes 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 #22786
    Mcp
    Member

    Hi, 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 #22787
    wzp
    Moderator

    Are 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.

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 16 total)
1 2 →
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ