Blackbenji
Lieutenant
- Registriert
- Nov. 2009
- Beiträge
- 565
Hallo,
ich habe mit dem iPhone ein Bild gemacht, es wurde hochkant aufgenommen.
Mittels folgendem Script lasse ich ein Thumbnail erstellen:
Das Problem ist nun, dass das Thumbnail nach Links gekippt ist.
Das Originalbild aber normal hochkant zu sehen ist.
Ich kann mir leider nicht erklären woher das kommt?
Hat jemand eine Idee für mich?
Anbei die Infos zu meinem Bild:

ich habe mit dem iPhone ein Bild gemacht, es wurde hochkant aufgenommen.
Mittels folgendem Script lasse ich ein Thumbnail erstellen:
PHP:
//Your Image
$imgSrc = "img_2576.jpg";
//getting the image dimensions
list($width, $height) = getimagesize($imgSrc);
//saving the image into memory (for manipulation with GD Library)
$myImage = imagecreatefromjpeg($imgSrc);
// calculating the part of the image to use for thumbnail
if ($width > $height) {
$y = 0;
$x = ($width - $height) / 2;
$smallestSide = $height;
} else {
$x = 0;
$y = ($height - $width) / 2;
$smallestSide = $width;
}
// copying the part into thumbnail
$thumbSize = 100;
$thumb = imagecreatetruecolor($thumbSize, $thumbSize);
imagecopyresampled($thumb, $myImage, 0, 0, $x, $y, $thumbSize, $thumbSize, $smallestSide, $smallestSide);
//final output
header('Content-type: image/jpeg');
imagejpeg($thumb);
Das Problem ist nun, dass das Thumbnail nach Links gekippt ist.
Das Originalbild aber normal hochkant zu sehen ist.
Ich kann mir leider nicht erklären woher das kommt?
Hat jemand eine Idee für mich?
Anbei die Infos zu meinem Bild:
