samtiria / nextgen-gallery

Automatically exported from code.google.com/p/nextgen-gallery
0 stars 0 forks source link

After Update to 1.9.2, Thumbnail images in NGG Backend do not show. #477

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hey Alex,

What steps will reproduce the problem?
1. Images already exist, loaded fine in backend manage galleries view before 
update to 1.9.2.
2. Reuploading an image with spaces in the image filename does reproduce the 
problem
3. Image displays fine on site frontend gallery but images are not displayed on 
backend (Manage Galleries ->  <Gallery Name> because NGG ignores the spacing in 
the image filename to display the image and thumbnail correctly.

What is the expected output? What do you see instead?
Thumbnails displaying correctly in Manage Galleries, seeing the broken image 
picture on all thumbnails.

What WordPress / NextGEN Gallery version are you using? What browser are
you using?
Wordpress 3.3.1 and NGG 1.9.2

Thanks Alex!
Marc

Original issue reported on code.google.com by bra...@gmail.com on 27 Feb 2012 at 3:41

GoogleCodeExporter commented 8 years ago
Adding the following to the /admin/functions.php line directly below line 489 
after: closedir($handle) will rename the files uploaded by removing the 
whitespace and provide a possible fix for the problem:

$fileName = basename($file);
$directoryPath = $dirname."/";

foreach($files as $k=>$file){
    if(strpos($file," ") >=0){
        $oldFilePath = $directoryPath.$file;

        $newFileName = str_ireplace(" ","",$file);
        $newFilePath = $directoryPath. $newFileName;

        rename($oldFilePath, $newFilePath);
        $files[$k] = $newFileName;
    }
}

Original comment by aimsdigi...@gmail.com on 3 Apr 2012 at 11:07

GoogleCodeExporter commented 8 years ago
Hi there, thanks for the code! Would this allow for the previous images already 
uploaded to be fixed?

Marc

Original comment by bra...@gmail.com on 26 Apr 2012 at 4:03

GoogleCodeExporter commented 8 years ago
Thanks, this worked like a charm! Just added this code, then re-scanned the 
folder, and all the thumbnails now work. So glad I didn't have to re-upload 
300mb of renamed photos.

Original comment by beezwi...@gmail.com on 1 Jul 2012 at 11:55

GoogleCodeExporter commented 8 years ago
Excellent! Fixed the problem for me too, after rummaging through doezens of 
posts that didn't help.

In version 1.9.13 the code goes after: closedir( $handle );  in line 245

Original comment by TDHarn...@gmail.com on 28 Jul 2013 at 3:55