Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Argh – it doesn’t work if the image files are small enough that they don’t need to be resized – this is what adds the widthxheight to the end of the filename as far as i can tell.

    For now I have added a rejection for any files that end in ‘myavatar’ .ext, and added a message to users that if their files don’t upload properly they should rename the file in that format.

    This is pretty poor, though. Is there any way I can set up a rejection of any files in the avatars folder that do not end in bpfull. or bpthumb.?

    Here is a way I have found to make avatar uploads work while still using a CDN. I’m using S3/Cloudfront but it shouldn’t make a difference.

    The avatars, once accepted have a filename that always ends in either ‘bpfull.jpg’ or ‘bpthumb.jpg’

    When an avatar is being dealt with by the upload/cropping process, the images used are not given these names.

    If uploaded at registration time they are stored in an avatars/signups/ folder

    If uploaded once a user is a registered member, they will always have the file size at the end of the filename (e.g. 200×200.jpg)

    Using this info, I did the following:

    in my custom file list, I added the following:

    `wp-content/uploads/avatars/*bpfull.*
    wp-content/uploads/avatars/*bpthumb.*`

    in my rejected files list, I added the following:

    `/wp-content/uploads/avatars/signups/*
    /wp-content/uploads/avatars/*/*x*.*`

    I’m not too happy with the rules for rejection, it seems like there might be a danger of having a file named xxxbpfull.jpg being rejected and sourced locally, but given that any files that don’t contain an x will be sourced from my CDN I am pretty happy with this level of fudgery. In any case, this does mean that the files required to process the cropping will be sourced locally and therefore avatar uploads will work.

    The last thing to do is to set the autoupload time to something reasonable – I have set it to 10 minutes at the moment mainly so I can check that this all works okay, and also to see how much the autoupload script hammers the server. If it were possible it would be nice to add a hook at the end of the avatar cropping function that calls an image upload to the CDN for the file that has been created, but waiting 10 minutes to an hour for an avatar is not so bad.

    Hopefully this is helpful, and if anybody has better rules for the rejected file list I would be super happy to see them.

    I ended up setting the time for all blogs to UTC, and disabling the time from the blog post metadata – time(‘F, j Y) instead of just time()

    It’s a kludgy fix but I guess it looks okay. I wish I’d just used the text box :)

    I’m also having this problem – any idea/fix for this?

Viewing 4 replies - 1 through 4 (of 4 total)
Skip to toolbar