Do tworzenia miniatur na stronie urzywam tego skryptu:
Kod
<?php
// The file
$filename = 'pliki/zdjecia/'.$kat.'/'.$id.'.jpg';
// Set a maximum height and width
$width = 100;
$height = 100;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// Output
imagejpeg($image_p, null, 100);
?>
// The file
$filename = 'pliki/zdjecia/'.$kat.'/'.$id.'.jpg';
// Set a maximum height and width
$width = 100;
$height = 100;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// Output
imagejpeg($image_p, null, 100);
?>
Skrypt w pliku 1.php gdzie jest tylko on działa jednak po wrzuceniu an strone nie pokazuje sie obrazek tylko wywala takie coś:
Kod
Warning: Cannot modify header information - headers already sent by (output started at d:\usr\apache\httpd\html\a\tapeta.php:7) in d:\usr\apache\httpd\html\a\tapeta.php on line 98
˙Ř˙ŕÉywşuŐŇÜĹ^Ű\EćXJżb1tiUĄRyâ0XÚÄaĽ SQĽ(Şľ(ĹÉÍş5$ŠŐQ2´ăŚ˙+d´mĂ;9lŰ=;ädŕőŻÓŮźEâ9 ľéöń5ŢŁyhŹ^ÖÖ#$ĺXŁÚ(K-,¤šuâYáž§;ĆńçŇŇé˘ÖV÷ôIhŰM;ODq0~ŇŁćşvßis_źUßUe˝ľ+üBń6ŁK{ŤÜÁ4Z|Â}6ęÖÉ.RÚ #IDŚ0˛¤rÇx÷c43ÄĂăŢÍŹ_Î%˝ytŰ#ćĎ<ÖihƲ¨@ťB$üČŔAM§éďž:ş˝ľÂÚ{ ĺ-¨[ó\°3ÜÝ: ĺÁr_tj -řŰKżé|9¤ÂÎ ýnč9-sőĚPŰB¤ŢS<ŞĹ\na,ßaŁĽHÂŰ~ÍÇľ8ŮśţÓM'5ČűŐ'U7NŁI9ť?zúEZÚ´Ów},ÖiiĽ_xę}Q`Xź7¤>ČńŹPJTË&÷źc,AŤG$Ľř˙ÍŞk:vV˛JŐ ą{IdňĎyk9ŕ śŇ: ¨ËŔëó˙gÎÇÚ
˙Ř˙ŕÉywşuŐŇÜĹ^Ű\EćXJżb1tiUĄRyâ0XÚÄaĽ SQĽ(Şľ(ĹÉÍş5$ŠŐQ2´ăŚ˙+d´mĂ;9lŰ=;ädŕőŻÓŮźEâ9 ľéöń5ŢŁyhŹ^ÖÖ#$ĺXŁÚ(K-,¤šuâYáž§;ĆńçŇŇé˘ÖV÷ôIhŰM;ODq0~ŇŁćşvßis_źUßUe˝ľ+üBń6ŁK{ŤÜÁ4Z|Â}6ęÖÉ.RÚ #IDŚ0˛¤rÇx÷c43ÄĂăŢÍŹ_Î%˝ytŰ#ćĎ<ÖihƲ¨@ťB$üČŔAM§éďž:ş˝ľÂÚ{ ĺ-¨[ó\°3ÜÝ: ĺÁr_tj -řŰKżé|9¤ÂÎ ýnč9-sőĚPŰB¤ŢS<ŞĹ\na,ßaŁĽHÂŰ~ÍÇľ8ŮśţÓM'5ČűŐ'U7NŁI9ť?zúEZÚ´Ów},ÖiiĽ_xę}Q`Xź7¤>ČńŹPJTË&÷źc,AŤG$Ľř˙ÍŞk:vV˛JŐ ą{IdňĎyk9ŕ śŇ: ¨ËŔëó˙gÎÇÚ
Skrypt pobiera zmienne z adresu. Z góry będe wdzięczny za pomoc bo już nie wiem co zrobić
