ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Duplicate image names causing member photos to show up on others profiles

July 19, 2010 9:04pm

Subscribe [1]
  • #1 / Jul 19, 2010 9:04pm

    JasonLeeLab

    53 posts

    I had an issue come up with ‘Image Sizer’ recently that I thought others might come across so I thought I would post my fix.

    Problem: Whenever a member uploads a photo with the same name of an existing file, the existing file is overwritten by the new file.  This was causing member photos being replaced by a different members photos.

    Fix: I modified the Image Sizer plugin on line 447 to include the original width the renamed file.

    Replace line 447:

    $img['out_name'] = $img['base_filename'].$color_space.'-'.$img['out_width'].'x'.$img['out_height'].'.'.$img['extension'];

    With:

    $img['out_name'] = $img['base_filename'].$color_space.'-'.$img['out_width'].'x'.$img['src_width'].'x'.$img['out_height'].'.'.$img['extension'];

    Feel free to comment if you see any issues with this or if there is a better way.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases