Notice: Undefined variable: _ in /var/www/vhosts/margionys.lt/httpdocs/chf/message.php on line 61
Notice: Undefined variable: _ in /var/www/vhosts/margionys.lt/httpdocs/chf/message.php on line 61
* @package CHF::CORE * @subpackage component * @filesource * @version v3.0/2006 */ /** * CHF_Component_Thumbnail * * @author Marius Kazemekaitis a.k.a cOdH * @package CHF::CORE * @subpackage component */ class CHF_Component_Thumbnail extends CHF_Component { /** * $errmsg * * Klaidos pranesimas parsinimui * * @author Marius Kazemekaitis a.k.a cOdH * @var string */ private $errmsg; /** * $error * * Pazymime kai ivyksta klaida * * @author Marius Kazemekaitis a.k.a cOdH * @var bool */ private $error; /** * $format * * Paveikslelio failo formatas * * @author Marius Kazemekaitis a.k.a cOdH * @var string */ private $format; /** * $currentDimensions * * Dabartiniai paveikslelio matmenys * * @author Marius Kazemekaitis a.k.a cOdH * @var array */ private $currentDimensions; /** * $newDimensions * * Nauji matmenys po apdirbimo * * @author Marius Kazemekaitis a.k.a cOdH * @var array */ private $newDimensions; /** * $newImage * * Galutinis paveikslelis atvaizdavimui arba issaugojimui * * @author Marius Kazemekaitis a.k.a cOdH * @var mixed */ private $newImage; /** * $oldImage * * Originalus paveikslelis apdirbimui * * @author Marius Kazemekaitis a.k.a cOdH * @var mixed */ private $oldImage; /** * $workingImage * * Apdirbamas paveikslelis * * @author Marius Kazemekaitis a.k.a cOdH * @var mixed */ private $workingImage; /** * $fileName * * Paveikslelio failo vardas. * Gali buti su direktorija * * @author Marius Kazemekaitis a.k.a cOdH * @var string */ public $fileName; /** * $maxWidth * * Maksimalus paveikslelio plotis * * @author Marius Kazemekaitis a.k.a cOdH * @var int */ public $maxWidth; /** * $maxHeight * * Maksimalus paveikslelio aukstis * * @author Marius Kazemekaitis a.k.a cOdH * @var int */ public $maxHeight; /** * $percent * * Procentinis paveikslelio dydis * * @author Marius Kazemekaitis a.k.a cOdH * @var int */ public $percent; /** * $quality * * JPEG paveikslelio kokybe * * @author Marius Kazemekaitis a.k.a cOdH * @var int */ public $quality; /** * $cropSize * * Dydis pikseliais paveikslelio iskirpimui (nuo centro) * * @author Marius Kazemekaitis a.k.a cOdH * @var int */ public $cropSize; public $cropX; public $cropY; /** * __construct * * @author Marius Kazemekaitis a.k.a cOdH * @return void */ public function __construct() { $this->errmsg = ''; $this->error = false; $this->format = ''; $this->currentDimensions = array(); $this->newDimensions = array(); $this->fileName = ''; $this->maxWidth = 0; $this->maxHeight = 0; $this->percent = 0; $this->quality = 60; $this->cropSize = 0; $this->cropX = 0; $this->cropY = 0; } /** * __destruct * * @author Marius Kazemekaitis a.k.a cOdH * @return void */ public function __destruct() { if($this->newImage) @ImageDestroy($this->newImage); if($this->oldImage) @ImageDestroy($this->oldImage); if($this->workingImage) @ImageDestroy($this->workingImage); } /** * init() * * Tikrinamos klaidos ir nustatomas failo tipas * * @author Marius Kazemekaitis a.k.a cOdH * @return void */ public function init() { if(!file_exists($this->fileName)) { $this->errmsg = "File not found"; $this->error = true; } elseif(!is_readable($this->fileName)) { $this->errmsg = "File is not readable"; $this->error = true; } if($this->error == false) { if(stristr(strtolower($this->fileName),'.gif')) $this->format = 'GIF'; elseif(stristr(strtolower($this->fileName),'.jpg') || stristr(strtolower($this->fileName),'.jpeg')) $this->format = "JPG"; elseif(stristr(strtolower($this->fileName),'.png')) $this->format = 'PNG'; else { $this->errmsg = "Unknown file format"; $this->error = true; } } if($this->maxWidth == 0 && $this->maxHeight == 0 && $this->percent == 0) $this->percent = 100; if($this->error == false) { switch($this->format) { case "GIF": $this->oldImage = ImageCreateFromGif($this->fileName); break; case "JPG": $this->oldImage = ImageCreateFromJpeg($this->fileName); break; case "PNG": $this->oldImage = ImageCreateFromPng($this->fileName); break; } $size = GetImageSize($this->fileName); $this->currentDimensions = array("width"=>$size[0],"height"=>$size[1]); $this->newImage = $this->oldImage; } if($this->error) { $this->showErrorImage(); break; } } public function getCurrentWidth() { return $this->currentDimensions['width']; } public function getCurrentHeight() { return $this->currentDimensions['height']; } public function calcWidth($width,$height) { $newWP = (100 * $this->maxWidth) / $width; $newHeight = ($height * $newWP) / 100; return array("newWidth"=>intval($this->maxWidth),"newHeight"=>intval($newHeight)); } public function calcHeight($width,$height) { $newHP = (100 * $this->maxHeight) / $height; $newWidth = ($width * $newHP) / 100; return array("newWidth"=>intval($newWidth),"newHeight"=>intval($this->maxHeight)); } public function calcPercent($width,$height) { $newWidth = ($width * $this->percent) / 100; $newHeight = ($height * $this->percent) / 100; return array("newWidth"=>intval($newWidth),"newHeight"=>intval($newHeight)); } public function calcImageSize($width,$height) { $newSize = array("newWidth"=>$width,"newHeight"=>$height); if($this->maxWidth > 0 && $width > $this->maxWidth) { $newSize = $this->calcWidth($width,$height); if($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) $newSize = $this->calcHeight($newSize['newWidth'],$newSize['newHeight']); $this->newDimensions = $newSize; } if($this->maxHeight > 0 && $height > $this->maxHeight) { $newSize = $this->calcHeight($width,$height); if($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) { $newSize = $this->calcWidth($newSize['newWidth'],$newSize['newHeight']); } $this->newDimensions = $newSize; } if($this->percent > 0) { $newSize = $this->calcPercent($width,$height); $this->newDimensions = $newSize; } } public function showErrorImage() { header("Content-type: image/png"); $errImg = ImageCreate(220,25); $bgColor = ImageColorAllocate($errImg,0,0,0); $fgColor1 = ImageColorAllocate($errImg,255,255,255); $fgColor2 = ImageColorAllocate($errImg,255,0,0); ImageString($errImg,3,6,6,"ERROR:",$fgColor2); ImageString($errImg,3,55,6,$this->errmsg,$fgColor1); ImagePng($errImg); ImageDestroy($errImg); } public function resize($name = '') { $this->calcImageSize($this->currentDimensions['width'],$this->currentDimensions['height']); if(function_exists("ImageCreateTrueColor")) { $this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'],$this->newDimensions['newHeight']); } else { $this->workingImage = ImageCreate($this->newDimensions['newWidth'],$this->newDimensions['newHeight']); } ImageCopyResampled( $this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newDimensions['newWidth'], $this->newDimensions['newHeight'], $this->currentDimensions['width'], $this->currentDimensions['height'] ); $this->oldImage = $this->workingImage; $this->newImage = $this->workingImage; $this->currentDimensions['width'] = $this->newDimensions['newWidth']; $this->currentDimensions['height'] = $this->newDimensions['newHeight']; } public function crop() { $cropX = intval(($this->currentDimensions['width'] - $this->cropSize) / 2); $cropY = intval(($this->currentDimensions['height'] - $this->cropSize) / 2); if(function_exists("ImageCreateTrueColor")) { $this->workingImage = ImageCreateTrueColor($this->cropSize,$this->cropSize); } else { $this->workingImage = ImageCreate($this->cropSize,$this->cropSize); } ImageCopy( $this->workingImage, $this->oldImage, 0, 0, $this->cropX, $this->cropY, $this->cropSize, $this->cropSize ); $this->oldImage = $this->workingImage; $this->newImage = $this->workingImage; $this->currentDimensions['width'] = $this->cropSize; $this->currentDimensions['height'] = $this->cropSize; } public function save($name) { $this->show($name); } function show($name='') { switch($this->format) { case "GIF": if($name != '') { ImageGif($this->newImage,$name); } else { header("Content-type: image/gif"); ImageGif($this->newImage); } break; case "JPG": if($name != '') { ImageJpeg($this->newImage,$name,$this->quality); } else { header("Content-type: image/jpeg"); ImageJpeg($this->newImage,'',$this->quality); } break; case "PNG": if($name != '') { ImagePng($this->newImage,$name); } else { header("Content-type: image/png"); ImagePng($this->newImage,$name); } break; } } } ?> Margionys - Čepkeliai
  •  
  •  
  •  
 

Čepkeliai

Čepkeliai Strict Nature Reserve is located only 10 km away from the house, next to the Marcinkonys village. This Reserve was established in 1975 in the most-Southern part of Lithuania, in order to protect the unique natural values contained within the ecosystem of a peatland, occupying an area of 11212 ha. The main protected natural assets include:

  • the largest marshland in Lithuania
  • continental dunes located next to the marshland
  • forests, being part of this ecosystem
  • rare flora and fauna species, typical for this ecosystem


Čepkeliai, after Lithuania having joined the Ramsar Convention in 1993, has been enlisted among the world's peatlands of an international significance.

Čepkeliai is also a Natura 2000 area. Natura 2000 is a European network of protected areas, aiming to protect and appropriately manage rare and vulnerable bird, animal and plant species and their habitats.

Website of the Reserve is only in Lithuanian. You have to note that a permit from park administration is required in order to be able to visit the Reserve. Even if you will manage to receive a permit, you will anyways have to walk only on designated paths and will be accompanied by the staff member.

In order to get to Čepkeliai from the house, you should go back towards Marcinkonys. After having reached Marcinkonys, at the first crossroads, do not turn left on the main road, as you would do if travelling to either Merkinė or Vilnius, but turn right, instead. You will immediately cross the railway. Go straight and stay on the right (main road will be turning left). After 100 meters or so of winding across the forest, you will reach administration building of the Reserve.

If you would like in advance to make an appointment to visit the Reserve, please contact administration at:

Phone: +370 310 44686
E-mail: cepkeliai@takas.lt