X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fupdate-gosa;h=c94fe9809fc0b7fc9212729fc86ed57d57cf831b;hb=394ad2f2583805c95da0acc47e9d78e28e61e43a;hp=0ae8950bbc48ef62b729a2f99c85d67072f42613;hpb=f34a10a5f0aac30df122f3aab5a6c7dd44e14d94;p=gosa.git diff --git a/gosa-core/update-gosa b/gosa-core/update-gosa index 0ae8950bb..c94fe9809 100755 --- a/gosa-core/update-gosa +++ b/gosa-core/update-gosa @@ -556,15 +556,15 @@ function rescan_images($path, $theme) // Grey image if it is not already one if (preg_match('/grey/', $indexPath)) { echo "!"; - $warnings[]= "Warning: skipped possible grey image $path"; + $warnings[]= "Warning: skipped possible *grey* image $path"; flush(); continue; } - // Grey image if it is not already one - if (preg_match('/new/', $indexPath)) { + // New image if it is not already one + if (preg_match('/new/', $indexPath) && !preg_match('/new\.png$/', $indexPath)) { echo "!"; - $warnings[]= "Warning: skipped possible grey image $path"; + $warnings[]= "Warning: skipped possible *new* image $path"; flush(); continue; } @@ -687,7 +687,7 @@ function rescan_images($path, $theme) // Move X cursor to the next position $cursorX+= $imageWidth; - $maxX=($colX > $maxX)?$colX:$maxX; + $maxX=($colX+$imageWidth > $maxX)?$colX+$imageWidth:$maxX; } // Print maximum dimensions @@ -710,7 +710,7 @@ function rescan_images($path, $theme) // Insert source image... - // And eventually convert it to grey before + // Eventually convert it to grey before if (preg_match('/-grey\.png$/', $imagePath)) { if (!function_exists("imageFilter")){ exec("convert ".$paths[$imagePath]." -colorspace Gray /tmp/grey-converted.png"); @@ -728,20 +728,17 @@ function rescan_images($path, $theme) imageDestroy($src); // Store style - if (isset($duplicates[$imagePath])){ - $imageHeight= $heights[$duplicates[$imagePath]]; - $imageWidth= $widths[$duplicates[$imagePath]]; - $x= $posX[$duplicates[$imagePath]]; - $y= $posY[$duplicates[$imagePath]]; - $styles[$imagePath]= "background-position:-$x -$y;width:".$imageWidth."px;height:".$imageHeight."px"; - } else { - $styles[$imagePath]= "background-position:-$x -$y;width:".$imageWidth."px;height:".$imageHeight."px"; - } + $styles[$imagePath]= "background-position:-".$x."px -".$y."px;width:".$imageWidth."px;height:".$imageHeight."px"; echo "."; flush(); } + /* Add duplicates */ + foreach ($duplicates as $imagePath => $realPath) { + $styles[$imagePath]= $styles[$realPath]; + } + imagePNG($dst, "html/themes/$theme/img.png", 9); imageDestroy($dst);