X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fupdate-gosa;h=2e54a2aa91df52e7754e3796cd2081bbfb45c1cb;hb=68778696752b2670a4f79f17459b04468a41fbdd;hp=be1de84a2d90655e40ba4101bbf61538b427f95e;hpb=0b9deba73d585d90b9dddb0ae997345f290ebc68;p=gosa.git diff --git a/gosa-core/update-gosa b/gosa-core/update-gosa index be1de84a2..2e54a2aa9 100755 --- a/gosa-core/update-gosa +++ b/gosa-core/update-gosa @@ -551,20 +551,20 @@ function rescan_images($path, $theme) // We're only interested in png files $indexPath= substr($fileInfo->getPathname(), $baseLength + 1); $path= $fileInfo->getPathname(); - if (preg_match('/\.png$/', $indexPath) && !preg_match('/\.svn/', $path) && !preg_match('/themes\/[^\/]+\/img.png$/', $path)){ + if (preg_match('/\.png$/', $indexPath) && !preg_match('/\.svn/', $path) && !preg_match('/themes\/[^\/]+\/images\/img.png$/', $path)){ // 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"); @@ -727,14 +727,6 @@ function rescan_images($path, $theme) imageCopyResampled($dst, $src, $x, $y, 0, 0, $imageWidth, $imageHeight, $imageWidth, $imageHeight); imageDestroy($src); - // Eventually overload with grey part - if (isset($duplicates[$imagePath])){ - $imageHeight= $heights[$duplicates[$imagePath]]; - $imageWidth= $widths[$duplicates[$imagePath]]; - $x= $posX[$duplicates[$imagePath]]; - $y= $posY[$duplicates[$imagePath]]; - } - // Store style $styles[$imagePath]= "background-position:-".$x."px -".$y."px;width:".$imageWidth."px;height:".$imageHeight."px"; @@ -742,7 +734,12 @@ function rescan_images($path, $theme) flush(); } - imagePNG($dst, "html/themes/$theme/img.png", 9); + /* Add duplicates */ + foreach ($duplicates as $imagePath => $realPath) { + $styles[$imagePath]= $styles[$realPath]; + } + + imagePNG($dst, "html/themes/$theme/images/img.png", 9); imageDestroy($dst); // Show warnings images