From: cajus Date: Mon, 1 Mar 2010 08:48:16 +0000 (+0000) Subject: Updated duplicate handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=65bfb157b04025de1afe4c07c0615150dc471818;p=gosa.git Updated duplicate handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15782 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/update-gosa b/gosa-core/update-gosa index be1de84a2..ace236ae4 100755 --- a/gosa-core/update-gosa +++ b/gosa-core/update-gosa @@ -587,7 +587,6 @@ function rescan_images($path, $theme) $warnings[]= "Warning: images $indexPath seems to be a duplicate of ".array_search($checksum, $checksums); $duplicates[$indexPath]= array_search($checksum, $checksums); $duplicates[$greyIndexPath]= preg_replace('/\.png$/', '-grey.png', array_search($checksum, $checksums)); - continue; } else { $checksums[$indexPath]= $checksum; } @@ -710,29 +709,30 @@ function rescan_images($path, $theme) // Insert source image... - // And 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"); - $src= imageCreateFromPng("/tmp/grey-converted.png"); - } else { - $src= imageCreateFromPng($paths[$imagePath]); - imageFilter($src, IMG_FILTER_GRAYSCALE); - } - } else { - $src= imageCreateFromPng($paths[$imagePath]); - } - - // Merge image - imageCopyResampled($dst, $src, $x, $y, 0, 0, $imageWidth, $imageHeight, $imageWidth, $imageHeight); - imageDestroy($src); - - // Eventually overload with grey part + // Duplicate? if (isset($duplicates[$imagePath])){ $imageHeight= $heights[$duplicates[$imagePath]]; $imageWidth= $widths[$duplicates[$imagePath]]; $x= $posX[$duplicates[$imagePath]]; $y= $posY[$duplicates[$imagePath]]; + } else { + + // 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"); + $src= imageCreateFromPng("/tmp/grey-converted.png"); + } else { + $src= imageCreateFromPng($paths[$imagePath]); + imageFilter($src, IMG_FILTER_GRAYSCALE); + } + } else { + $src= imageCreateFromPng($paths[$imagePath]); + } + + // Merge image + imageCopyResampled($dst, $src, $x, $y, 0, 0, $imageWidth, $imageHeight, $imageWidth, $imageHeight); + imageDestroy($src); } // Store style