Results 1 to 8 of 8
  1. #1
    NEC
    NEC is offline
    Casual Pligger NEC's Avatar
    Joined
    Jan 2007
    Posts
    51
    Thanks
    Received:0
    Given: 0

    Avatar size/extension check

    Hi
    there should be checks for size and extension. i'm proposing that we should check these because of
    1. avoiding unnecessary storage of big files
    2. avoiding upload of dangerous non-image files like naughtyfile.jpg.vbs

  2. #2
    Pligg Donor dollars5's Avatar
    Joined
    Dec 2006
    Posts
    1,960
    Thanks
    Received:0
    Given: 0
    Good suggestion, We can do a client side check for extension.

    Size - we can resize anything at server.

  3. #3
    Pligg Developer/Admin kbeeveer46's Avatar
    Joined
    Jun 2006
    Posts
    3,215
    Thanks
    Received:1
    Given: 0
    The class.pThumb.php file that handles the image uploads I believe already checks for file extensions. Now, I'm not sure about checking to see how big the original image is.

  4. #4
    NEC
    NEC is offline
    Casual Pligger NEC's Avatar
    Joined
    Jan 2007
    Posts
    51
    Thanks
    Received:0
    Given: 0
    Quote Originally Posted by dollars5 View Post
    Good suggestion, We can do a client side check for extension.

    Size - we can resize anything at server.
    client-side check is not sufficient because a user knowing a little HTML can easily by-pass.

  5. #5
    Casual Pligger bergs's Avatar
    Joined
    Sep 2006
    Posts
    43
    Thanks
    Received:0
    Given: 0
    The class.pThumb.php file does check for extentions.

    I've been trying to figure out a way to add a few lines of code to the class.pThumb.php file that will crop all uploaded images to an equal 100 x 100 size.

    Any ideas?

  6. #6
    NEC
    NEC is offline
    Casual Pligger NEC's Avatar
    Joined
    Jan 2007
    Posts
    51
    Thanks
    Received:0
    Given: 0
    crop size can be set afaik but point is pligg stores the original image also. for example, one can upload a 1 mb file. even after cropping to 30 and 15, 1 mb file is still there eating storage.

  7. #7
    Casual Pligger bergs's Avatar
    Joined
    Sep 2006
    Posts
    43
    Thanks
    Received:0
    Given: 0

    Problems with avatar upload in pligg 9

    NEC,

    I discovered that too - I agree, keeping users original photos is not a good idea! I really have been having a lot of problems with the current avatar upload code in pligg 9.

    Especially with caching of avatars. I have done some research and found that using time() in the filename can act as a work around. But it can't work with the current codebase. The current code just looks for {$user}_120.jpg after a user has submitted "useruploaded" to the db.

    And, another problem with the current avatar uploader in pligg 9 is if a user selects the "I'd like to upload my avatar" radio and submits, then navigates to another page without uploading an image the image will appear as missing/broken rather than the default gravatar showing as it did with pligg 7.

    -bergs

  8. #8
    Constant Pligger cent's Avatar
    Joined
    Jan 2007
    Posts
    180
    Thanks
    Received:0
    Given: 0
    Why not just modify the routine to unlink the original file after it has been successfully been resized? Afaik there isn't a way to change the avatar sizes in the admin and update all of the existing avatars to match so the original will never be needed again.

    For changing avatars there should be some sort of javascript check to prevent people from changing it without actually uploading something. OR... a file check to see if the avatar exists and if not, then show a default image.

Similar Threads

  1. What is the default avatar size??
    By kevin4uguys in forum Questions & Comments
    Replies: 5
    Last Post: 04-05-2010, 05:24 AM
  2. Replies: 1
    Last Post: 02-04-2009, 10:12 AM
  3. [SOLVED] Avatar size comments and main page help.
    By gameradam in forum Questions & Comments
    Replies: 1
    Last Post: 04-03-2008, 04:04 AM
  4. Firefox extension
    By Daidy in forum Questions & Comments
    Replies: 2
    Last Post: 04-08-2007, 04:01 AM
  5. Changing avatar size - 2 questions
    By revolver in forum Questions & Comments
    Replies: 1
    Last Post: 03-13-2007, 04:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg